pub trait Node<S: GraphState>: Send + Sync {
// Required method
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 S,
ctx: &'life2 NodeCtx<'life3>,
) -> Pin<Box<dyn Future<Output = Result<NodeOut<S>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn name(&self) -> &str { ... }
fn retry_policy(&self) -> Option<NodeRetryPolicy> { ... }
}Expand description
The unit of computation in a graph. Async, takes a &S snapshot of state
- per-step context, returns a delta + a routing decision.
Required Methods§
Sourcefn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 S,
ctx: &'life2 NodeCtx<'life3>,
) -> Pin<Box<dyn Future<Output = Result<NodeOut<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 S,
ctx: &'life2 NodeCtx<'life3>,
) -> Pin<Box<dyn Future<Output = Result<NodeOut<S>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute one superstep of this node.
Provided Methods§
Sourcefn retry_policy(&self) -> Option<NodeRetryPolicy>
fn retry_policy(&self) -> Option<NodeRetryPolicy>
Per-task retry policy. Default None means “no retry — propagate
the error”. When Some, the engine retries execute on retryable
errors with exponential backoff.