pub struct ProgressTracker { /* private fields */ }Expand description
A progress tracker for multi-step operations
Tracks the current step and provides methods to display progress with optional verbose mode.
§Examples
use oxur_cli::common::progress::ProgressTracker;
let mut progress = ProgressTracker::new(true); // verbose mode
progress.step("Parsing input");
// ... do work ...
progress.done();
progress.step("Generating output");
// ... do work ...
progress.done();
progress.success("All operations completed!");Implementations§
Source§impl ProgressTracker
impl ProgressTracker
Sourcepub fn step(&mut self, msg: &str)
pub fn step(&mut self, msg: &str)
Start a new step in the process
In verbose mode, displays: “N. message…” In non-verbose mode, does nothing
Sourcepub fn done(&self)
pub fn done(&self)
Mark the current step as complete
In verbose mode, displays: “ ✓ Done“ (in green) In non-verbose mode, does nothing
Sourcepub fn success(&self, msg: &str)
pub fn success(&self, msg: &str)
Display a final success message
Always displays, regardless of verbose mode. In verbose mode, adds a blank line before the message.
Sourcepub fn error(&self, msg: &str)
pub fn error(&self, msg: &str)
Display an error message
Always displays, regardless of verbose mode.
Sourcepub fn is_verbose(&self) -> bool
pub fn is_verbose(&self) -> bool
Check if verbose mode is enabled
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