pub struct Pipeline {
pub stages: Vec<Stage>,
}Expand description
Ordered stages evaluated until one halts.
Fields§
§stages: Vec<Stage>The stages, in execution order.
Implementations§
Source§impl Pipeline
impl Pipeline
Sourcepub fn with_stage(self, stage: Stage) -> Self
pub fn with_stage(self, stage: Stage) -> Self
Append a stage, builder style.
Sourcepub fn run(&self) -> RunReport
pub fn run(&self) -> RunReport
Evaluate stages in order, stopping after the first that halts.
Stages after a halt are not evaluated and do not appear in the report, which is the honest shape: they never ran, so they have no outcome.
use gate_contract::{Gate, Pipeline, Stage};
let run = Pipeline::new()
.with_stage(Stage::new("intake").with_gate(Gate::pass("scope-present")))
.with_stage(Stage::new("harvest").with_gate(Gate::unevaluable("api", "no key")))
.with_stage(Stage::new("build").with_gate(Gate::pass("never-reached")))
.run();
assert!(run.halted());
assert_eq!(run.reports.len(), 2);
assert_eq!(run.halted_stage(), Some("harvest"));Trait Implementations§
impl Eq for Pipeline
impl StructuralPartialEq for Pipeline
Auto Trait Implementations§
impl Freeze for Pipeline
impl RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnsafeUnpin for Pipeline
impl UnwindSafe for Pipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more