Trait agnostic_lite::AsyncLocalSpawner
source · pub trait AsyncLocalSpawner: Copy + 'static {
type JoinHandle<F>: Detach + Future + 'static
where F: 'static;
// Required method
fn spawn_local<F>(future: F) -> Self::JoinHandle<F::Output>
where F::Output: 'static,
F: Future + 'static;
// Provided method
fn spawn_local_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>: Detach + Future + 'static
where
F: 'static
type JoinHandle<F>: Detach + Future + 'static where F: 'static
The handle returned by the spawner when a future is spawned.
Required Methods§
sourcefn spawn_local<F>(future: F) -> Self::JoinHandle<F::Output>
fn spawn_local<F>(future: F) -> Self::JoinHandle<F::Output>
Spawn a future.
Provided Methods§
sourcefn spawn_local_detach<F>(future: F)
fn spawn_local_detach<F>(future: F)
Spawn a future and detach it.
Object Safety§
This trait is not object safe.
Implementors§
source§impl AsyncLocalSpawner for AsyncStdSpawner
Available on crate feature async-std only.
impl AsyncLocalSpawner for AsyncStdSpawner
Available on crate feature
async-std only.type JoinHandle<F> = JoinHandle<F> where F: 'static
source§impl AsyncLocalSpawner for SmolSpawner
Available on crate feature smol only.
impl AsyncLocalSpawner for SmolSpawner
Available on crate feature
smol only.type JoinHandle<F> = Task<F> where F: 'static
source§impl AsyncLocalSpawner for TokioSpawner
Available on crate feature tokio only.
impl AsyncLocalSpawner for TokioSpawner
Available on crate feature
tokio only.type JoinHandle<F> = JoinHandle<F> where F: 'static
source§impl AsyncLocalSpawner for WasmSpawner
Available on crate feature wasm only.
impl AsyncLocalSpawner for WasmSpawner
Available on crate feature
wasm only.