Skip to main content

Step

Trait Step 

Source
pub trait Step:
    'static
    + Clone
    + Debug
    + PartialEq
    + Eq
    + Hash {
    type Output: Clone;

    // Required method
    fn run(self, builder: &Builder<'_>) -> Self::Output;

    // Provided method
    fn metadata(&self) -> Option<StepMetadata> { ... }
}
Expand description

A unit of work within bootstrap that is cached to avoid redundant execution. Steps can be performed via Builder::ensure.

Historically, steps also participated in command-line processing. That responsibility has been split off into the larger CommandLineStep trait, which helper steps don’t need to implement.

Required Associated Types§

Source

type Output: Clone

Result type of Step::run. Stored in the step cache for later lookup.

Required Methods§

Source

fn run(self, builder: &Builder<'_>) -> Self::Output

Executes this step.

Called by Builder::ensure if no cached result was found for this step.

Provided Methods§

Source

fn metadata(&self) -> Option<StepMetadata>

Returns metadata of the step, for tests.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§