pub trait Node: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 NodeContext,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput, GraphError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided method
fn execute_stream<'a>(
&'a self,
ctx: &'a NodeContext,
) -> Pin<Box<dyn Stream<Item = Result<StreamEvent, GraphError>> + Send + 'a>> { ... }
}Available on crate feature
graph only.Expand description
A node in the graph
Required Methods§
Sourcefn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 NodeContext,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput, GraphError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 NodeContext,
) -> Pin<Box<dyn Future<Output = Result<NodeOutput, GraphError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Execute the node and return state updates
Provided Methods§
Sourcefn execute_stream<'a>(
&'a self,
ctx: &'a NodeContext,
) -> Pin<Box<dyn Stream<Item = Result<StreamEvent, GraphError>> + Send + 'a>>
fn execute_stream<'a>( &'a self, ctx: &'a NodeContext, ) -> Pin<Box<dyn Stream<Item = Result<StreamEvent, GraphError>> + Send + 'a>>
Stream execution events (default: wraps execute)