pub struct PipelineProgress { /* private fields */ }Expand description
Progress display for multi-stage pipeline operations.
Tracks and renders progress through the RCH compile pipeline:
- Workspace analysis (file enumeration)
- Upload to worker (rsync)
- Remote compilation (cargo)
- Artifact retrieval (rsync)
- Cache update (optional)
§Example
ⓘ
use rch_common::ui::{OutputContext, PipelineProgress, PipelineStage};
let ctx = OutputContext::detect();
let mut pipeline = PipelineProgress::new(ctx, "worker1", false);
pipeline.start_stage(PipelineStage::WorkspaceAnalysis);
pipeline.set_stage_detail("425 files");
pipeline.complete_stage();
pipeline.start_stage(PipelineStage::Upload);
pipeline.set_stage_detail("78.1 MB");
pipeline.complete_stage();
pipeline.finish();Implementations§
Source§impl PipelineProgress
impl PipelineProgress
Sourcepub fn new(ctx: OutputContext, worker: impl Into<String>, quiet: bool) -> Self
pub fn new(ctx: OutputContext, worker: impl Into<String>, quiet: bool) -> Self
Create a new pipeline progress display.
Sourcepub fn start_stage(&mut self, stage: PipelineStage)
pub fn start_stage(&mut self, stage: PipelineStage)
Start a new pipeline stage.
Sourcepub fn set_stage_detail(&mut self, detail: impl Into<String>)
pub fn set_stage_detail(&mut self, detail: impl Into<String>)
Set detail text for the current stage (e.g., “425 files”, “78.1 MB”).
Sourcepub fn update_detail(&mut self, detail: impl Into<String>)
pub fn update_detail(&mut self, detail: impl Into<String>)
Update the current stage detail (rate-limited render).
Sourcepub fn complete_stage(&mut self)
pub fn complete_stage(&mut self)
Complete the current stage successfully.
Sourcepub fn skip_stage(&mut self, stage: PipelineStage, reason: impl Into<String>)
pub fn skip_stage(&mut self, stage: PipelineStage, reason: impl Into<String>)
Skip a stage with a reason.
Sourcepub fn fail_stage(&mut self, error: impl Into<String>)
pub fn fail_stage(&mut self, error: impl Into<String>)
Mark the current stage as failed.
Sourcepub fn set_cache_saved_time(&mut self, saved: Duration)
pub fn set_cache_saved_time(&mut self, saved: Duration)
Set time saved due to cache hit.
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Check if any stage has failed.
Sourcepub fn current_stage(&self) -> Option<PipelineStage>
pub fn current_stage(&self) -> Option<PipelineStage>
Get the current stage if any.
Sourcepub fn finish_error(&mut self, error: &str)
pub fn finish_error(&mut self, error: &str)
Finish with error summary.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PipelineProgress
impl RefUnwindSafe for PipelineProgress
impl Send for PipelineProgress
impl Sync for PipelineProgress
impl Unpin for PipelineProgress
impl UnsafeUnpin for PipelineProgress
impl UnwindSafe for PipelineProgress
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