pub trait Runner {
type Context;
// Required method
fn start<F, Fut>(self, f: F) -> Fut::Output
where F: FnOnce(Self::Context) -> Fut,
Fut: Future;
}Expand description
Interface that any task scheduler must implement to start running tasks.
Required Associated Types§
Required Methods§
Sourcefn start<F, Fut>(self, f: F) -> Fut::Output
fn start<F, Fut>(self, f: F) -> Fut::Output
Start running a root task.
When this function returns, all spawned tasks will be canceled. If clean
shutdown cannot be implemented via Drop, consider using Spawner::stop and
Spawner::stopped to coordinate clean shutdown.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".