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
stateandinputas 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§
Sourcefn execute(
&self,
state: &S,
input: &ExecutionStepInput,
) -> Result<StepResult, KernelError>
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§
impl<S, F> ExecutionStep<S> for Fwhere
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.