Trait FuncSpawner

Source
pub unsafe trait FuncSpawner<T> {
    type FutureOutput;
    type SpawnHandle: Future<Output = Self::FutureOutput> + Send;

    // Required method
    fn spawn_func<F: FnOnce() -> T + Send + 'static>(
        &self,
        f: F,
    ) -> Self::SpawnHandle;
}

Required Associated Types§

Required Methods§

Source

fn spawn_func<F: FnOnce() -> T + Send + 'static>( &self, f: F, ) -> Self::SpawnHandle

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§