Skip to main content

Runnable

Trait Runnable 

Source
pub trait Runnable<Event, State> {
    // Required methods
    fn id(&self) -> TaskId;
    fn run(&self, state: State) -> impl Future<Output = Result<Event>> + Send;
}
Expand description

A task that can be run and return an output

Required Methods§

Source

fn id(&self) -> TaskId

a unique identifier for the task, should be unique across all tasks, nodes and plugins

Source

fn run(&self, state: State) -> impl Future<Output = Result<Event>> + Send

run the task and return the output if this method is called multiple times, it should return the same output

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§