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. Example of possible services provided by the context include:

  • Clock for time-based operations
  • Network for network operations
  • Storage for storage operations

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.

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.

Implementors§

Source§

impl Runner for commonware_runtime::deterministic::Runner

Source§

impl Runner for commonware_runtime::tokio::Runner