pub trait ProgressTracker: Send + Sync {
    // Required methods
    fn clone_box(&self) -> Box<dyn ProgressTracker>;
    fn tick(&mut self, state: &ProgressState, now: Instant);
    fn reset(&mut self, state: &ProgressState, now: Instant);
    fn write(&self, state: &ProgressState, w: &mut dyn Write);
}
Expand description

Trait for defining stateful or stateless formatters

Required Methods§

source

fn clone_box(&self) -> Box<dyn ProgressTracker>

Creates a new instance of the progress tracker

source

fn tick(&mut self, state: &ProgressState, now: Instant)

Notifies the progress tracker of a tick event

source

fn reset(&mut self, state: &ProgressState, now: Instant)

Notifies the progress tracker of a reset event

source

fn write(&self, state: &ProgressState, w: &mut dyn Write)

Provides access to the progress bar display buffer for custom messages

Trait Implementations§

source§

impl Clone for Box<dyn ProgressTracker>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

source§

impl<F> ProgressTracker for F
where F: Fn(&ProgressState, &mut dyn Write) + Send + Sync + Clone + 'static,