Skip to main content

ExecutorState

Trait ExecutorState 

Source
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 compatiblebuild_node_context 返回带生命周期的 NodeContextapply_batch 使用泛型)。仅用于静态分发(T: ExecutorState<S>),不用于 dyn ExecutorState<S>

Required Methods§

Source

fn build_node_context(&mut self) -> NodeContext<'_, S>

Source

fn build_leaf_context(&mut self) -> LeafContext<'_, S>

Source

fn clone_state(&self) -> S

Source

fn replace_state(&mut self, state: S)

Source

fn apply_batch(&mut self, mutations: impl IntoIterator<Item = S::Mutation>)

Source

fn take_control(&mut self) -> (NextAction, Option<ExecutionSignal>)

Source

fn take_metadata(&mut self) -> NodeMetadata

Source

fn take_flow_events(&mut self) -> Vec<FlowEvent>

Source

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".

Implementors§