Trait Node

Source
pub trait Node<C: Context = ()>: Send + Sync {
    type Input: Send + Sync;
    type Output: Send + Sync;

    // Required method
    fn process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: &'life1 C,
        input: Self::Input,
    ) -> Pin<Box<dyn Future<Output = Result<Transition<Self::Output>, FloxideError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A node takes an input and a context, and returns a transition.

Required Associated Types§

Source

type Input: Send + Sync

Input type for the node

Source

type Output: Send + Sync

Output type produced by the node

Required Methods§

Source

fn process<'life0, 'life1, 'async_trait>( &'life0 self, ctx: &'life1 C, input: Self::Input, ) -> Pin<Box<dyn Future<Output = Result<Transition<Self::Output>, FloxideError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process an input value within the given context, producing a transition

Implementors§

Source§

impl<C, I, O, F> Node<C> for SplitNode<I, O, F>
where C: Context, I: Send + Sync + 'static, O: Send + Sync + 'static, F: Fn(I) -> Vec<O> + Send + Sync,

Source§

type Input = I

Source§

type Output = O

Source§

impl<C, N> Node<C> for BatchNode<C, N>
where C: Context + 'static, N: Node<C> + Clone + Send + Sync + 'static, <N as Node<C>>::Input: Clone + Send + 'static, <N as Node<C>>::Output: Send + 'static,

Source§

type Input = Vec<<N as Node<C>>::Input>

Source§

type Output = Vec<<N as Node<C>>::Output>

Source§

impl<C, N> Node<C> for RetryNode<N>
where C: Context + RetryDelay, N: Node<C> + Clone + Send + Sync + 'static, N::Input: Clone + Send + 'static, N::Output: Send + 'static,

Source§

type Input = <N as Node<C>>::Input

Source§

type Output = <N as Node<C>>::Output

Source§

impl<C, W> Node<C> for CompositeNode<C, W>

Source§

type Input = <W as Workflow<C>>::Input

Source§

type Output = <W as Workflow<C>>::Output