# IoCompletionBinding

`import { IoCompletionBinding } from "destack:io/binding";`

Completion binding family.

```ds title="IoCompletionBinding"
export interface IoCompletionBinding {
    openIoCompletion(entries: uint32): Result<IoCompletionHandle, HostError>;
    closeIoCompletion(completion: IoCompletionHandle): Result<void, HostError>;
    bindIoCompletion(completion: IoCompletionHandle, resource: ResourceId, key: uint64): Result<void, HostError>;
    unbindIoCompletion(completion: IoCompletionHandle, resource: ResourceId): Result<void, HostError>;
    postIoCompletion(completion: IoCompletionHandle, event: IoCompletionEvent): Result<void, HostError>;
    waitIoCompletion(completion: IoCompletionHandle, events: &'a [IoCompletionEvent], timeoutNs?: uint64 | undefined): Result<uint32, HostError>;
    cancelIoCompletion(completion: IoCompletionHandle, resource: ResourceId): Result<uint32, HostError>;
}
```

[language/library/src/io/binding/completion.ds:21:101](https://github.com/destack-sh/destack/blob/main/language/library/src/io/binding/completion.ds#L21-L101)

## Members

### `openIoCompletion(entries: uint32): Result<IoCompletionHandle, HostError>`

Open a completion queue.

### `closeIoCompletion(completion: IoCompletionHandle): Result<void, HostError>`

Close a completion queue.

### `bindIoCompletion(completion: IoCompletionHandle, resource: ResourceId, key: uint64): Result<void, HostError>`

Bind one resource to a completion queue.

### `unbindIoCompletion(completion: IoCompletionHandle, resource: ResourceId): Result<void, HostError>`

Unbind one resource from a completion queue.

### `postIoCompletion(completion: IoCompletionHandle, event: IoCompletionEvent): Result<void, HostError>`

Post one synthetic completion event.

### `waitIoCompletion(completion: IoCompletionHandle, events: &'a [IoCompletionEvent], timeoutNs?: uint64 | undefined): Result<uint32, HostError>`

Wait for completion events.

### `cancelIoCompletion(completion: IoCompletionHandle, resource: ResourceId): Result<uint32, HostError>`

Cancel queued completions for one resource.
