Skip to main content

Executor

Trait Executor 

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

Spawns futures onto a background executor. Implementations must actually run the future to completion independently of the caller awaiting anything - Client::from_transport’s read loop, on()’s per-action handler loop, and on_ping()’s subscriber loop all rely on spawn to keep running in the background.

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§