Expand description
Synchronous completion utilities for async FFI callbacks
This module provides a generic mechanism for blocking on async Swift FFI callbacks and propagating results (success or error) back to Rust synchronously.
§Example
use screencapturekit::utils::completion::SyncCompletion;
// Create completion for a String result
let (completion, _context) = SyncCompletion::<String>::new();
// In real use, context would be passed to FFI callback
// The callback would signal completion with a result
// Block until callback completes (would hang without callback)
// let result = completion.wait();Structs§
- Async
Completion - An async completion handler for FFI callbacks
- Async
Completion Future - Future returned by
AsyncCompletion - Sync
Completion - A synchronous completion handler for async FFI callbacks
Functions§
- error_
from_ ⚠cstr - Helper to extract error message from a C string pointer
Type Aliases§
- Sync
Completion Ptr - Raw pointer type for passing to FFI callbacks
- Unit
Completion - Unit completion - for operations that return success/error without a value