FutureSpawner

Trait FutureSpawner 

Source
pub trait FutureSpawner:
    MaybeSend
    + MaybeSync
    + 'static {
    // Required method
    fn spawn<T: Future<Output = ()> + MaybeSend + 'static>(&self, future: T);
}
Expand description

A generic trait which is able to spawn futures in the background.

Required Methods§

Source

fn spawn<T: Future<Output = ()> + MaybeSend + 'static>(&self, future: T)

Spawns the given future as a background task.

This method MUST NOT block on the given future immediately.

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§