TaskSpawner

Trait TaskSpawner 

Source
pub trait TaskSpawner:
    Send
    + Sync
    + 'static {
    // Required method
    fn cancel_token(&self) -> Arc<CancellationToken>;

    // Provided method
    fn spawn_task<F: Future<Output = Result<()>> + Send + 'static>(
        &self,
        future: F,
    ) { ... }
}

Required Methods§

Provided Methods§

Source

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

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§