pub trait AsyncLocalSpawner:
Yielder
+ Copy
+ 'static {
type JoinHandle<O: 'static>: LocalJoinHandle<O> + 'static;
// Required method
fn spawn_local<F>(future: F) -> Self::JoinHandle<<F as Future>::Output>
where <F as Future>::Output: 'static,
F: Future + 'static;
// Provided method
fn spawn_local_detach<F>(future: F)
where <F as Future>::Output: 'static,
F: Future + 'static { ... }
}Expand description
A spawner trait for spawning futures.
Required Associated Types§
Sourcetype JoinHandle<O: 'static>: LocalJoinHandle<O> + 'static
type JoinHandle<O: 'static>: LocalJoinHandle<O> + 'static
The handle returned by the spawner when a future is spawned.
Required Methods§
Sourcefn spawn_local<F>(future: F) -> Self::JoinHandle<<F as Future>::Output>
fn spawn_local<F>(future: F) -> Self::JoinHandle<<F as Future>::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.
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.