pub trait ExecutorState<S: WorkflowState>: ExecutionView<S> {
// Required methods
fn build_node_context(&mut self) -> NodeContext<'_, S>;
fn build_leaf_context(&mut self) -> LeafContext<'_, S>;
fn clone_state(&self) -> S;
fn replace_state(&mut self, state: S);
fn apply_batch(&mut self, mutations: impl IntoIterator<Item = S::Mutation>);
fn take_control(&mut self) -> (NextAction, Option<ExecutionSignal>);
fn take_metadata(&mut self) -> NodeMetadata;
fn take_flow_events(&mut self) -> Vec<FlowEvent>;
fn emit_flow_event(&mut self, event: FlowEvent);
}Expand description
完整能力 — Composite 节点 + LeafAdapter 使用。
§注意
此 trait 不是 dyn compatible(build_node_context 返回带生命周期的 NodeContext,
apply_batch 使用泛型)。仅用于静态分发(T: ExecutorState<S>),不用于 dyn ExecutorState<S>。
Required Methods§
fn build_node_context(&mut self) -> NodeContext<'_, S>
fn build_leaf_context(&mut self) -> LeafContext<'_, S>
fn clone_state(&self) -> S
fn replace_state(&mut self, state: S)
fn apply_batch(&mut self, mutations: impl IntoIterator<Item = S::Mutation>)
fn take_control(&mut self) -> (NextAction, Option<ExecutionSignal>)
fn take_metadata(&mut self) -> NodeMetadata
fn take_flow_events(&mut self) -> Vec<FlowEvent>
Sourcefn emit_flow_event(&mut self, event: FlowEvent)
fn emit_flow_event(&mut self, event: FlowEvent)
发射控制面 FlowEvent(Composite 节点如 ParallelNode 需要)。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".