pub trait PluginAsyncRuntime:
Clone
+ Send
+ Sync {
// Required methods
fn spawn(&self, fut: FfiFuture<()>) -> FfiFuture<()>;
fn sleep(&self, dur: RDuration) -> FfiFuture<()>;
fn timeout(
&self,
dur: RDuration,
fut: FfiFuture<()>,
) -> FfiFuture<RResult<(), ()>>;
fn block_on(&self, fut: FfiFuture<()>);
fn yield_now(&self) -> FfiFuture<()>;
}Expand description
Async runtime for performing asynchronous operations in the plugin.
See [PluginTokioWrapper] on the host side for FFI-safe implementation.
Required Methods§
fn spawn(&self, fut: FfiFuture<()>) -> FfiFuture<()>
fn sleep(&self, dur: RDuration) -> FfiFuture<()>
fn timeout( &self, dur: RDuration, fut: FfiFuture<()>, ) -> FfiFuture<RResult<(), ()>>
fn block_on(&self, fut: FfiFuture<()>)
fn yield_now(&self) -> FfiFuture<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".