Trait agnostic_lite::AsyncLocalSpawner
source · pub trait AsyncLocalSpawner: Copy + 'static {
type JoinHandle<F>: Future + 'static
where F: 'static;
// Required method
fn spawn<F>(future: F) -> Self::JoinHandle<F::Output>
where F::Output: 'static,
F: Future + 'static;
// Provided method
fn spawn_detach<F>(future: F)
where F::Output: 'static,
F: Future + 'static { ... }
}Expand description
A spawner trait for spawning futures.
Required Associated Types§
sourcetype JoinHandle<F>: Future + 'static
where
F: 'static
type JoinHandle<F>: Future + 'static where F: 'static
The handle returned by the spawner when a future is spawned.
Required Methods§
Provided Methods§
sourcefn spawn_detach<F>(future: F)
fn spawn_detach<F>(future: F)
Spawn a future and detach it.
Object Safety§
This trait is not object safe.