pub struct ProgressTracker { /* private fields */ }Expand description
Tracks execution progress and provides real-time updates
Maintains:
- Current step index
- Completed steps count
- Execution start time
- Step durations for time estimation
- Progress callbacks for UI updates
Implementations§
Source§impl ProgressTracker
impl ProgressTracker
Sourcepub fn new(plan: &ExecutionPlan) -> Self
pub fn new(plan: &ExecutionPlan) -> Self
Sourcepub fn on_progress<F>(&self, callback: F)
pub fn on_progress<F>(&self, callback: F)
Register a progress callback
Callbacks are called whenever progress is updated.
§Arguments
callback- Function to call on progress updates
Sourcepub fn step_completed(&mut self, step_duration: Duration)
pub fn step_completed(&mut self, step_duration: Duration)
Update progress to the next step
Increments the current step and records the duration of the previous step.
§Arguments
step_duration- Duration of the completed step
Sourcepub fn step_skipped(&mut self)
pub fn step_skipped(&mut self)
Skip a step
Marks a step as skipped without recording a duration.
Sourcepub fn get_progress(&self) -> ProgressUpdate
pub fn get_progress(&self) -> ProgressUpdate
Sourcepub fn current_step(&self) -> usize
pub fn current_step(&self) -> usize
Get the current step index (0-based)
Sourcepub fn total_steps(&self) -> usize
pub fn total_steps(&self) -> usize
Get the total number of steps
Sourcepub fn completed_steps(&self) -> usize
pub fn completed_steps(&self) -> usize
Get the number of completed steps
Sourcepub fn progress_percentage(&self) -> f32
pub fn progress_percentage(&self) -> f32
Get the overall progress percentage (0-100)
Sourcepub fn estimated_time_remaining(&self) -> Duration
pub fn estimated_time_remaining(&self) -> Duration
Get the estimated time remaining
Sourcepub fn elapsed_time(&self) -> Duration
pub fn elapsed_time(&self) -> Duration
Get the total elapsed time
Sourcepub fn average_step_duration(&self) -> Duration
pub fn average_step_duration(&self) -> Duration
Get the average step duration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProgressTracker
impl RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnwindSafe for ProgressTracker
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