pub trait Step: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn title(&self) -> &'static str;
fn reference_script(&self) -> &'static str;
fn step_version(&self) -> u32;
fn is_done(&self, ctx: &HostContext) -> bool;
fn plan(&self, ctx: &mut HostContext) -> Result<Vec<PlannedAction>>;
fn apply(&self, ctx: &mut HostContext) -> Result<()>;
// Provided methods
fn schema_version(&self) -> u32 { ... }
fn depends_on(&self) -> &'static [&'static str] { ... }
fn needs_reboot_after(&self) -> bool { ... }
fn destructive(&self) -> bool { ... }
}Expand description
One setup / ops step. Implemented by isolated modules under steps/.
Steps are versioned (step_version) and may declare dependencies (depends_on).
Surfaces call crate::setup_run / crate::setup_step rather than steps directly.
Required Methods§
Sourcefn reference_script(&self) -> &'static str
fn reference_script(&self) -> &'static str
Legacy shell script this step absorbs (documentation / tip-sync).
Sourcefn step_version(&self) -> u32
fn step_version(&self) -> u32
Implementation version; resume marks stale when this increases.
Sourcefn is_done(&self, ctx: &HostContext) -> bool
fn is_done(&self, ctx: &HostContext) -> bool
Heuristic: already completed on this host layout.
Sourcefn plan(&self, ctx: &mut HostContext) -> Result<Vec<PlannedAction>>
fn plan(&self, ctx: &mut HostContext) -> Result<Vec<PlannedAction>>
Record planned actions without mutating the host (also used in dry-run apply).
§Errors
Returns crate::HortoError when planning cannot inspect host state or build the action list.
Sourcefn apply(&self, ctx: &mut HostContext) -> Result<()>
fn apply(&self, ctx: &mut HostContext) -> Result<()>
Execute or plan according to HostContext::mode.
§Errors
Returns crate::HortoError when apply fails (I/O, missing deps, cancelled confirms, …).
Provided Methods§
Sourcefn schema_version(&self) -> u32
fn schema_version(&self) -> u32
Schema of the step trait itself (rarely bumped).
Sourcefn depends_on(&self) -> &'static [&'static str]
fn depends_on(&self) -> &'static [&'static str]
Step ids that must be Done before this step may run.
Sourcefn needs_reboot_after(&self) -> bool
fn needs_reboot_after(&self) -> bool
Advise a reboot after a successful apply.
Sourcefn destructive(&self) -> bool
fn destructive(&self) -> bool
True when apply can overwrite live host config.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".