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§
- Async
Completion - Factory for future-based FFI completion handles.
- Async
Completion Future - Future returned by
AsyncCompletion::create. - Sync
Completion - 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_TIMEOUTin whole seconds;0disables 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§
- Sync
Completion Ptr - Opaque value passed through FFI callbacks.
- Unit
Completion - Completion for operations that return only success or an error.