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§
Required Methods§
Provided Methods§
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.