pub trait Node: Send + Sync {
// Required methods
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut GraphState,
context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = RGraphResult<ExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn id(&self) -> &NodeId;
fn name(&self) -> &str;
// Provided methods
fn description(&self) -> Option<&str> { ... }
fn input_keys(&self) -> Vec<&str> { ... }
fn output_keys(&self) -> Vec<&str> { ... }
fn validate(&self, _state: &GraphState) -> RGraphResult<()> { ... }
fn metadata(&self) -> NodeMetadata { ... }
}Expand description
Core trait for all executable nodes in the workflow graph
Required Methods§
Sourcefn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut GraphState,
context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = RGraphResult<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut GraphState,
context: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = RGraphResult<ExecutionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute the node with the given state and context
Provided Methods§
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Get the node’s description
Sourcefn input_keys(&self) -> Vec<&str>
fn input_keys(&self) -> Vec<&str>
Get the expected input keys from the state
Sourcefn output_keys(&self) -> Vec<&str>
fn output_keys(&self) -> Vec<&str>
Get the output keys that this node will write to the state
Sourcefn validate(&self, _state: &GraphState) -> RGraphResult<()>
fn validate(&self, _state: &GraphState) -> RGraphResult<()>
Validate that the node can execute with the current state
Sourcefn metadata(&self) -> NodeMetadata
fn metadata(&self) -> NodeMetadata
Get node metadata for observability