Executor

Trait Executor 

Source
pub trait Executor:
    Clone
    + Sync
    + Send
    + 'static {
    // Required method
    fn spawn<F>(&self, future: F)
       where F: Future + Send + 'static,
             F::Output: Send;
}

Required Methods§

Source

fn spawn<F>(&self, future: F)
where F: Future + Send + 'static, F::Output: Send,

spawns the task to run in background, and returns a join handle where the future’s result can be awaited. If the future panics, the join handle should return an error code. This is primarily used by mssf Bridge to execute user app async callbacks/notifications. User app impl future may panic, and mssf propagates panic as an error in JoinHandle to SF.

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§