Executor

Trait Executor 

Source
pub trait Executor:
    Send
    + Sync
    + 'static
    + Clone {
    // Required method
    fn spawn(&mut self, future: Pin<Box<dyn Future<Output = ()> + Send>>);
}
Expand description

A value that executes futures. see tokio::Executor

Required Methods§

Source

fn spawn(&mut self, future: Pin<Box<dyn Future<Output = ()> + Send>>)

Spawns a future object to run on this executor.

future is passed to the executor, which will begin running it. The future may run on the current thread or another thread at the discretion of the Executor implementation.

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§