pub struct AsyncBridge { /* private fields */ }Expand description
Bridge for executing async operations from sync FFI context
Implementations§
Source§impl AsyncBridge
impl AsyncBridge
Sourcepub fn new(runtime: Arc<AsyncRuntime>) -> Self
pub fn new(runtime: Arc<AsyncRuntime>) -> Self
Create a new async bridge
Sourcepub fn next_request_id(&self) -> u64
pub fn next_request_id(&self) -> u64
Get the next request ID
Sourcepub fn call_sync<F, T>(&self, future: F) -> PluginResult<T>where
F: Future<Output = PluginResult<T>>,
pub fn call_sync<F, T>(&self, future: F) -> PluginResult<T>where
F: Future<Output = PluginResult<T>>,
Execute an async operation synchronously (blocking)
This is the primary method for handling sync FFI calls.
Sourcepub fn call_sync_timeout<F, T>(
&self,
future: F,
timeout: Duration,
) -> PluginResult<T>where
F: Future<Output = PluginResult<T>>,
pub fn call_sync_timeout<F, T>(
&self,
future: F,
timeout: Duration,
) -> PluginResult<T>where
F: Future<Output = PluginResult<T>>,
Execute an async operation with timeout
Sourcepub fn spawn<F, T>(&self, future: F) -> JoinHandle<T>
pub fn spawn<F, T>(&self, future: F) -> JoinHandle<T>
Spawn an async task and return a handle
Sourcepub fn shutdown_signal(&self) -> ShutdownSignal
pub fn shutdown_signal(&self) -> ShutdownSignal
Get a shutdown signal
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Check if the runtime is shutting down
Auto Trait Implementations§
impl !Freeze for AsyncBridge
impl !RefUnwindSafe for AsyncBridge
impl Send for AsyncBridge
impl Sync for AsyncBridge
impl Unpin for AsyncBridge
impl !UnwindSafe for AsyncBridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more