Skip to main content

ExecutionMode

Trait ExecutionMode 

Source
pub trait ExecutionMode: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        ctx: &mut dyn ExecutionContext,
        recipe: &Recipe,
        run_dir: &Path,
    ) -> Result<ExecutionResult, ExecutionError>;
}
Expand description

Public execution-mode trait.

Implementations receive &mut dyn ExecutionContext and must not downcast to a concrete runner. This is enforced by taking a trait object.

Required Methods§

Source

fn name(&self) -> &str

Mode name (e.g. “scripted_pty”).

Source

fn execute( &self, ctx: &mut dyn ExecutionContext, recipe: &Recipe, run_dir: &Path, ) -> Result<ExecutionResult, ExecutionError>

Execute the recipe, returning steps, assertions, raw output, exit code, and screen.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§