pub trait Spawn: Clone {
// Required method
fn spawn_local(&self, f: impl Future<Output = ()> + 'static);
// Provided method
fn spawn(&self, f: impl Future<Output = ()> + Send + 'static) { ... }
}
Expand description
Implementation for spawning tasks on an executor.
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.