Skip to main content

Runner

Trait Runner 

Source
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§

Source

type Context

Context defines the environment available to tasks.

Required Methods§

Source

fn start<F, Fut>(self, f: F) -> Fut::Output
where F: FnOnce(Self::Context) -> Fut, Fut: Future,

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".

Implementors§

Source§

impl Runner for commonware_runtime::deterministic::Runner

Source§

impl Runner for commonware_runtime::tokio::Runner