Skip to main content

StepExecutor

Trait StepExecutor 

Source
pub trait StepExecutor: Send + Sync {
    // Required methods
    fn kind(&self) -> StepKind;
    fn execute(
        &self,
        provider: &Arc<dyn AgentProvider>,
    ) -> impl Future<Output = Result<StepOutput, EngineError>> + Send;
}
Expand description

Trait for step executors.

Each step type implements this trait to execute its specific operation and return a StepOutput.

Required Methods§

Source

fn kind(&self) -> StepKind

The StepKind this executor handles.

The dispatcher uses it to label spans and metrics, so a new step type only has to declare its kind here instead of extending a match in execute_step_config.

Source

fn execute( &self, provider: &Arc<dyn AgentProvider>, ) -> impl Future<Output = Result<StepOutput, EngineError>> + Send

Execute the step and return structured output.

§Errors

Returns EngineError if the operation fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§