TaskSpawner

Trait TaskSpawner 

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

A trait for spawning a future onto an asynchronous runtime.

Required Methods§

Source

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

Spawns a type-erased future.

Implementors§

Source§

impl TaskSpawner for TokioSpawner

Available on crate feature tokio only.