Skip to main content

Module node

Module node 

Source
Expand description

Node trait + per-superstep context + helper closure adapter.

Structs§

NodeCtx
Per-superstep context handed to every Node::execute call. Carries run-correlation metadata and the active RunnableConfig. The lifetime is the superstep — don’t hold across awaits beyond execute returning.
NodeFn
Closure adapter — wrap any Fn(&S, &NodeCtx) -> Future as a Node.
NodeOut
Output of a node’s execute: a typed state delta + where to go next.
NodeRetryPolicy
Per-task retry policy. The engine wraps Node::execute calls in a retry loop when the node returns a Some policy and the call fails with a cognis_core::CognisError whose is_retryable() is true.

Traits§

Node
The unit of computation in a graph. Async, takes a &S snapshot of state

Functions§

node_fn
Build a NodeFn from a closure. The closure receives (&S, &NodeCtx) and returns Future<Output = Result<NodeOut<S>>>.