Runner

Trait Runner 

Source
pub trait Runner<'a, Input, Output, Error, Context, InnerData>: Send + Sync {
    // Required method
    fn run(
        &self,
        data: InnerData,
        input: Input,
        context: &'a mut Context,
    ) -> impl Future<Output = Result<NodeOutput<Output>, Error>> + Send;
}
Expand description

The Runner is used in FnFlow and is basically a replacement for Node.

It defines how Input and inner data is processed into an Output (and Error) with a given Context.

See also FnFlow, Node.

Required Methods§

Source

fn run( &self, data: InnerData, input: Input, context: &'a mut Context, ) -> impl Future<Output = Result<NodeOutput<Output>, Error>> + Send

Executes the runner using the provided inner data, input, and context.

§Parameters
  • data: Inner data used in this runner.
  • input: The input data to process.
  • context: Mutable reference to the a context.

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<'a, Input, Output, Error, Context, InnerData, T, F> Runner<'a, Input, Output, Error, Context, InnerData> for T
where Input: Send, F: Future<Output = Result<NodeOutput<Output>, Error>> + Send + 'a, T: Fn(InnerData, Input, &'a mut Context) -> F + Send + Sync, Context: 'a,