pub struct ProgressLogger { /* private fields */ }Expand description
Logger for handling output with quiet mode and cargo-style progress bars.
This logger is designed for operations with known progress (like processing multiple files). It uses progress bars rather than spinners.
Implementations§
Source§impl ProgressLogger
impl ProgressLogger
Sourcepub fn new(quiet: bool) -> Self
pub fn new(quiet: bool) -> Self
Create a new progress logger.
quiet- If true, suppresses all output
Sourcepub fn should_show_progress(&self) -> bool
pub fn should_show_progress(&self) -> bool
Check if progress should be shown based on cargo’s term.progress.when setting (respects CARGO_TERM_PROGRESS_WHEN environment variable).
Returns true if progress should be shown, false otherwise.
Sourcepub fn set_progress(&mut self, total: u64)
pub fn set_progress(&mut self, total: u64)
Set a status message with a progress bar (ephemeral, like cargo’s “Compiling”).
total- Total number of items to process
Sourcepub fn set_message(&self, msg: &str)
pub fn set_message(&self, msg: &str)
Update progress status message.
Sourcepub fn println(&mut self, msg: &str)
pub fn println(&mut self, msg: &str)
Print a permanent message (will be kept in output).
Format matches cargo’s style: “ ✓ message“ or “ message“
Auto Trait Implementations§
impl Freeze for ProgressLogger
impl RefUnwindSafe for ProgressLogger
impl Send for ProgressLogger
impl Sync for ProgressLogger
impl Unpin for ProgressLogger
impl UnwindSafe for ProgressLogger
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.