Skip to main content

StepFactory

Trait StepFactory 

Source
pub trait StepFactory<T: DatabaseConnection>: Send + Sync {
    // Required methods
    fn step_name(&self) -> &'static str;
    fn create(&self) -> Box<dyn BootstrapStep<T>>;
}
Expand description

Factory for creating bootstrap steps.

Used for type-safe dependency declarations. When a step declares a dependency, it provides a factory that can create the dependency step if it’s not already registered in the runner.

Required Methods§

Source

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

Returns the name of the step this factory creates.

Source

fn create(&self) -> Box<dyn BootstrapStep<T>>

Creates a new instance of the step.

Implementors§