pub trait Spawn {
// Required method
fn spawn_task<F>(&self, task: F)
where F: Future<Output = ()> + Send + 'static;
}
Expand description
Spawn
abstract async runtime, spawns a future onto the runtime
Required Methods§
Sourcefn spawn_task<F>(&self, task: F)
fn spawn_task<F>(&self, task: F)
This spawns the given future onto the runtime’s executor
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.