Skip to main content

PluginAsyncRuntime

Trait PluginAsyncRuntime 

Source
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§

Source

fn spawn(&self, fut: FfiFuture<()>) -> FfiFuture<()>

Source

fn sleep(&self, dur: RDuration) -> FfiFuture<()>

Source

fn timeout( &self, dur: RDuration, fut: FfiFuture<()>, ) -> FfiFuture<RResult<(), ()>>

Source

fn block_on(&self, fut: FfiFuture<()>)

Source

fn yield_now(&self) -> FfiFuture<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PluginAsyncRuntime for DirectTokioProxy

Source§

impl<'lt, _ErasedPtr> PluginAsyncRuntime for PluginAsyncRuntime_TO<'lt, _ErasedPtr>
where Self: Clone + Send + Sync, _ErasedPtr: AsPtr<PtrTarget = ()>,