Skip to main content

Module completion

Module completion 

Source
Expand description

Completion handles for Swift bridge callbacks.

Synchronous waits are bounded by default. Callback contexts are opaque monotonic tokens backed by a process registry, not addresses. A callback that arrives after timeout/cancellation, or fires more than once, therefore finds no registry entry and returns without touching freed memory.

Structs§

AsyncCompletion
Factory for future-based FFI completion handles.
AsyncCompletionFuture
Future returned by AsyncCompletion::create.
SyncCompletion
A blocking completion handler for asynchronous FFI callbacks.

Constants§

DEFAULT_TIMEOUT
Default bound for synchronous waits and async completion futures.
TIMEOUT_ENV_VAR
Overrides DEFAULT_TIMEOUT in whole seconds; 0 disables the bound.
TIMEOUT_MESSAGE_PREFIX
Stable prefix for timeout errors.

Functions§

default_timeout
Effective process-wide wait bound.
error_from_cstr⚠
Convert an optional NUL-terminated C string into an owned Rust string.
is_timeout_error
Whether an error came from a bounded wait expiring.
timed_out_context_count
Number of synchronous operations that reached their wait deadline.

Type Aliases§

SyncCompletionPtr
Opaque value passed through FFI callbacks.
UnitCompletion
Completion for operations that return only success or an error.