Skip to main content

StepRunner

Trait StepRunner 

Source
pub trait StepRunner:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &'static str;
    fn execute(
        &self,
        ctx: &StepContext,
        input: ExecutorInput,
    ) -> Pin<Box<dyn Future<Output = Result<StepResult>> + Send + '_>>;

    // Provided method
    fn reap_snapshots<'a>(
        &'a self,
        _snapshots: Vec<SnapshotRef>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>> { ... }
}
Expand description

Async trait implemented by step executors (e.g. the VM runner).

Each runner is identified by a string Self::name that pipeline authors reference in their step definitions.

The execute method returns a boxed future so the trait remains dyn-compatible (async fn in trait is not object-safe).

Required Methods§

Source

fn name(&self) -> &'static str

Unique name for this runner (e.g. "vm").

Source

fn execute( &self, ctx: &StepContext, input: ExecutorInput, ) -> Pin<Box<dyn Future<Output = Result<StepResult>> + Send + '_>>

Execute a single pipeline step.

§Errors

Implementations should return Err for infrastructure failures (container boot failure, network error, etc.). A non-zero exit code from the user command is not an error — it is reported via StepResult::exit_code.

Provided Methods§

Source

fn reap_snapshots<'a>( &'a self, _snapshots: Vec<SnapshotRef>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>

Reap transient snapshots once a run has finished.

Ephemeral (uncached) leaf steps commit a snapshot purely so a downstream BuildsIn child can restore from it; nothing else holds a reference and the cache registry never tracks them. The scheduler collects every such snapshot and calls this at run end (best-effort) so they don’t leak in the backend store. The default is a no-op for runners that produce no reapable snapshots.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§