Module sync_completion

Module sync_completion 

Source
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::sync_completion::{SyncCompletion, SyncCompletionPtr};

// Create completion for a String result
let (completion, context) = SyncCompletion::<String>::new();

// Pass context to FFI, which will call back with result
unsafe { some_ffi_call(context, callback) };

// Block until callback completes
let result = completion.wait();

Structs§

AsyncCompletion
An async completion handler for FFI callbacks
AsyncCompletionFuture
Future returned by AsyncCompletion
SyncCompletion
A synchronous completion handler for async FFI callbacks

Functions§

error_from_cstr
Helper to extract error message from a C string pointer

Type Aliases§

SyncCompletionPtr
Raw pointer type for passing to FFI callbacks
UnitCompletion
Unit completion - for operations that return success/error without a value