Trait async_skipdb::AsyncSpawner

source ·
pub trait AsyncSpawner: Yielder + Copy + Send + Sync + 'static {
    type JoinHandle<F: Send + 'static>: Detach + Future + Send + Sync + 'static;

    // Required method
    fn spawn<F>(future: F) -> Self::JoinHandle<<F as Future>::Output>
       where <F as Future>::Output: Send + 'static,
             F: Future + Send + 'static;

    // Provided method
    fn spawn_detach<F>(future: F)
       where <F as Future>::Output: Send + 'static,
             F: Future + Send + 'static { ... }
}
Expand description

A spawner trait for spawning futures.

Required Associated Types§

source

type JoinHandle<F: Send + 'static>: Detach + Future + Send + Sync + 'static

The handle returned by the spawner when a future is spawned.

Required Methods§

source

fn spawn<F>(future: F) -> Self::JoinHandle<<F as Future>::Output>
where <F as Future>::Output: Send + 'static, F: Future + Send + 'static,

Spawn a future.

Provided Methods§

source

fn spawn_detach<F>(future: F)
where <F as Future>::Output: Send + 'static, F: Future + Send + 'static,

Spawn a future and detach it.

Object Safety§

This trait is not object safe.

Implementors§