Skip to main content

Executor

Trait Executor 

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

Trait for spawning background futures in an executor/runtime-agnostic way.

Required Methods§

Source

fn spawn(&self, fut: impl Future<Output = ()> + Send + 'static)

Spawns a future on the executor.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Executor for FuchsiaExecutor

Source§

impl Executor for TokioExecutor

Available on crate feature tokio only.