pub struct NodeOutput {
pub deltas: Vec<StateDelta>,
pub next: NextStep,
pub metadata: Option<NodeMetadata>,
}Expand description
节点执行输出 — 修改意图 + 下一步。
节点不再直接修改 State(&mut State),而是输出 Vec<StateDelta>。
Executor 收集所有 Delta 后统一 apply 到 State。
Fields§
§deltas: Vec<StateDelta>状态增量(节点对 State 的修改意图)
next: NextStep下一步路由
metadata: Option<NodeMetadata>节点元数据(可选 — 用于 Adaptive Checkpoint 等)
Implementations§
Source§impl NodeOutput
impl NodeOutput
Sourcepub fn with_delta(self, delta: StateDelta) -> Self
pub fn with_delta(self, delta: StateDelta) -> Self
追加一个 Delta。
Sourcepub fn with_deltas(self, deltas: Vec<StateDelta>) -> Self
pub fn with_deltas(self, deltas: Vec<StateDelta>) -> Self
追加多个 Delta。
Sourcepub fn with_metadata(self, metadata: NodeMetadata) -> Self
pub fn with_metadata(self, metadata: NodeMetadata) -> Self
设置节点元数据。
Sourcepub fn with_token_cost(self, cost: f64) -> Self
pub fn with_token_cost(self, cost: f64) -> Self
设置 token 成本。
Sourcepub fn with_side_effects(self) -> Self
pub fn with_side_effects(self) -> Self
标记有副作用。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeOutput
impl RefUnwindSafe for NodeOutput
impl Send for NodeOutput
impl Sync for NodeOutput
impl Unpin for NodeOutput
impl UnsafeUnpin for NodeOutput
impl UnwindSafe for NodeOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more