Skip to main content

Spawn

Trait Spawn 

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

The shape is deliberately copied from hyper::rt::Executor: generic over the future, zero bounds in the declaration. Send is added by the impl, not the trait, so single-threaded runtimes can implement it honestly.

Required Methods§

Source

fn spawn(&self, f: F)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§