Skip to main content

Module node_context

Module node_context 

Source
Expand description

NodeContext + LeafContext — 节点能力视图。

职责分离:

  • LeafContext<'a, S> — 只读视图,Leaf 节点使用(&S,不能修改 State)
  • NodeContext<'a, S> — 可变视图,向后兼容(&mut S,可通过 replace_state() 修改)

ExecutionEngine 和相关 trait 定义在 [execution_engine] 模块中。

Re-exports§

pub use crate::execution_engine::ExecutionContext;

Structs§

LeafContext
Leaf 节点能力视图 — 纯借用,不拥有任何状态。
NodeContext
节点能力视图 — 向后兼容,节点能做的三件事:读 State、记录 Mutation、发射 Stream。