AsyncEngine

Trait AsyncEngine 

Source
pub trait AsyncEngine: 'static {
    // Required methods
    fn background(f: impl FnOnce() + Send + 'static);
    fn block_on<R: Send + Sync + 'static>(
        f: impl FnOnce() -> R + Send + Sync + 'static,
    ) -> impl Future<Output = R> + Send + Sync;
    fn exec_after(delay: Duration, f: impl FnOnce() + Send + 'static);
}

Required Methods§

Source

fn background(f: impl FnOnce() + Send + 'static)

Source

fn block_on<R: Send + Sync + 'static>( f: impl FnOnce() -> R + Send + Sync + 'static, ) -> impl Future<Output = R> + Send + Sync

Source

fn exec_after(delay: Duration, f: impl FnOnce() + Send + 'static)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§