xvc_pipeline/pipeline/deps/
step.rs

1//! An explicit step dependency in a pipeline. Unlike other dependencies, this depends directly to
2//! other steps and runs after them.
3use serde::{Deserialize, Serialize};
4use xvc_core::types::diff::Diffable;
5
6use xvc_core::persist;
7
8use crate::XvcDependency;
9
10/// Invalidates when the dependency step is invalidated.
11#[derive(Debug, PartialOrd, Ord, Clone, Eq, PartialEq, Serialize, Deserialize)]
12pub struct StepDep {
13    /// The name of the step
14    pub name: String,
15}
16
17persist!(StepDep, "step-dependency");
18
19impl From<StepDep> for XvcDependency {
20    fn from(val: StepDep) -> Self {
21        XvcDependency::Step(val)
22    }
23}
24
25impl StepDep {
26    /// Create a new step depdenency
27    pub fn new(name: String) -> Self {
28        Self { name }
29    }
30}
31
32impl Diffable for StepDep {
33    type Item = Self;
34}