Skip to main content

Node

Trait Node 

Source
pub trait Node<S: State>: Send + Sync {
    // Required method
    fn process<'life0, 'async_trait>(
        &'life0 self,
        state: S,
    ) -> Pin<Box<dyn Future<Output = Result<S, SynapseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A node in the graph that processes state.

Required Methods§

Source

fn process<'life0, 'async_trait>( &'life0 self, state: S, ) -> Pin<Box<dyn Future<Output = Result<S, SynapseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl Node<MessageState> for ToolNode

Source§

impl<S, F, Fut> Node<S> for FnNode<S, F, Fut>
where S: State, F: Fn(S) -> Fut + Send + Sync, Fut: Future<Output = Result<S, SynapseError>> + Send,