Skip to main content

Executor

Trait Executor 

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

Required Methods§

Source

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

spawns the task to run in background. This is primarily used by mssf Bridge to execute user app async callbacks/notifications.

Source

fn spawn_blocking<F, R>(&self, func: F)
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,

Runs the provided function on an executor dedicated to blocking operations.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§