pub struct PlannedStep {
pub name: String,
pub kind: StepKind,
pub workflow: String,
pub depth: u32,
pub depends_on: Vec<String>,
pub condition: Option<ConditionResult>,
pub parallel_group: Option<String>,
pub estimated_duration: Option<Duration>,
}Expand description
One step the planner expects the run to create.
§Examples
use ironflow_engine::plan::PlannedStep;
use ironflow_store::entities::StepKind;
let step = PlannedStep {
name: "build".to_string(),
kind: StepKind::Shell,
workflow: "deploy".to_string(),
depth: 0,
depends_on: Vec::new(),
condition: None,
parallel_group: None,
estimated_duration: None,
};
assert_eq!(step.name, "build");Fields§
§name: StringStep name as the handler declares it.
kind: StepKindKind of operation this step performs.
workflow: StringWorkflow that owns this step (top-level name, or the sub-workflow’s).
depth: u32Sub-workflow nesting depth; 0 for the top-level workflow.
depends_on: Vec<String>Names of the steps this one runs after.
Names, not identifiers: the same name can appear twice when two branches or two sub-workflows declare a step with the same name. Consumers must key on position, not on name.
condition: Option<ConditionResult>Branch condition recorded just before this step, if the handler declared one.
A condition pending before a parallel wave attaches to the first member of the wave only.
parallel_group: Option<String>Parallel wave this step belongs to, when it runs concurrently with its siblings.
estimated_duration: Option<Duration>Average duration of this step across past completed runs.
Implementations§
Source§impl PlannedStep
impl PlannedStep
Sourcepub fn estimated_duration_ms(&self) -> Option<u64>
pub fn estimated_duration_ms(&self) -> Option<u64>
This step’s estimate in whole milliseconds, when it has one.
§Examples
use std::time::Duration;
use ironflow_engine::plan::PlannedStep;
use ironflow_store::entities::StepKind;
let step = PlannedStep {
name: "build".to_string(),
kind: StepKind::Shell,
workflow: "deploy".to_string(),
depth: 0,
depends_on: Vec::new(),
condition: None,
parallel_group: None,
estimated_duration: Some(Duration::from_millis(250)),
};
assert_eq!(step.estimated_duration_ms(), Some(250));