Skip to main content

Node

Trait Node 

Source
pub trait Node<State: GraphState>: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        state: State,
    ) -> Pin<Box<dyn Future<Output = GraphResult<State>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Node trait alias for simple state-only nodes.

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, state: State, ) -> Pin<Box<dyn Future<Output = GraphResult<State>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the node and return updated state.

Source

fn name(&self) -> &str

Get the node name.

Implementors§

Source§

impl<State, F, Fut> Node<State> for FunctionNode<State, F, Fut>
where State: GraphState, F: Fn(State) -> Fut + Send + Sync, Fut: Future<Output = GraphResult<State>> + Send,