Expand description
节点核心类型与模块。
v0.4 终态架构:
LeafNode<S>— 声明式业务节点,只能读 State + emit MutationExecutorOperation<S>— 命令式执行控制,可以 clone/merge/replace_stateNodeKind<S, M>— Graph 的 AST(不实现任何执行 trait)FlowNode<S>— 向后兼容,等同于 LeafNode
职责边界:
Graph (AST)
└── NodeKind
ExecutionEngine (runtime owner)
├── dispatch → match NodeKind
├── build_leaf_context() → LeafNode
└── pass &mut self → ExecutorOperation
LeafNode
└── 只能 emit Mutation
ExecutorOperation
└── 可以操纵 Executor(fork / merge / replace_state / subgraph)Re-exports§
pub use super::node_context::LeafContext;pub use super::barrier_node::BarrierDefaultAction;pub use super::barrier_node::BarrierNode;pub use super::parallel_node::ParallelErrorStrategy;pub use super::parallel_node::ParallelNode;pub use super::parallel_node::ParallelNodeBuilder;
Structs§
- Condition
Node - 条件分支节点。
- Condition
Node Builder - ConditionNode 构建器。
- Task
Node - 自定义逻辑节点。
Enums§
- Node
Kind - Graph 的 AST — 节点类型枚举。
Traits§
- Executor
Operation - 命令式执行控制 — Composite 节点使用。
- Flow
Node - 向后兼容 —
FlowNodetrait。 - Leaf
Node - 声明式业务节点 — 只能读 State + emit Mutation。
Type Aliases§
- Branch
Condition - 条件分支回调类型别名。
- Graph
Node - 向后兼容别名 —
GraphNode→FlowNode。 - TaskFn
- Task 节点回调类型别名(向后兼容 NodeContext)。