pub trait FlowNode<S: WorkflowState = State>: Send + Sync {
// Required method
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut NodeContext<'life2, S>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
向后兼容 — FlowNode trait。
保留此名称以兼容现有代码。
接收 NodeContext(持有 &mut S),以便旧代码继续工作。
Required Methods§
Sourcefn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut NodeContext<'life2, S>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + 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,
ctx: &'life1 mut NodeContext<'life2, S>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
执行节点逻辑。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<S: WorkflowState> FlowNode<S> for BarrierNode<S>
impl<S: WorkflowState> FlowNode<S> for ConditionNode<S>
ConditionNode 实现 FlowNode(向后兼容 — 使用 NodeContext)。
impl<S: WorkflowState> FlowNode<S> for TaskNode<S>
TaskNode 实现 FlowNode(向后兼容 — 使用 NodeContext)。
未来将迁移到 LeafNode + LeafContext。