Skip to main content

ExecutionStep

Trait ExecutionStep 

Source
pub trait ExecutionStep<S: KernelState>: Send + Sync {
    // Required method
    fn execute(
        &self,
        state: &S,
        input: &ExecutionStepInput,
    ) -> Result<StepResult, KernelError>;
}
Expand description

Canonical execution step trait: pure boundary between kernel and adapters.

Implementations must:

  • Take only state and input as inputs (no hidden mutable state, no I/O).
  • Return only a StepResult (or error); all effects go through the result.

The driver calls execute(state, input) and applies the returned StepResult; adapters (e.g. graph, agent) implement this trait and interact solely through it.

Required Methods§

Source

fn execute( &self, state: &S, input: &ExecutionStepInput, ) -> Result<StepResult, KernelError>

Performs one step: given current state and explicit input, returns the next outcome.

Pure boundary: no async, no hidden mutations. Inputs and outputs are explicit.

Implementors§

Source§

impl<S, F> ExecutionStep<S> for F
where S: KernelState, F: StepFn<S>,

Blanket impl: any crate::kernel::step::StepFn is an ExecutionStep with input ignored.

This keeps existing step functions (e.g. [crate::graph::step_adapter::GraphStepFnAdapter]) valid under the frozen contract; they receive ExecutionStepInput::Initial each time.