Trait Spawn

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

A trait for spawning futures.

Required Methods§

Source

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

Spawn a future and return a cancellable future.

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§