Skip to main content

ProgressRenderer

Trait ProgressRenderer 

Source
pub trait ProgressRenderer: Send + Sync {
    // Required methods
    fn on_start(&self, value: usize, max: usize);
    fn on_update(&self, value: usize, max: usize);
    fn on_finish(&self);
}
Expand description

Defines how a progress bar should be rendered

Required Methods§

Source

fn on_start(&self, value: usize, max: usize)

Called when the ProgressBar which holds the instance of Self is spawned

Source

fn on_update(&self, value: usize, max: usize)

Called when the ProgressBar which holds the instance of Self is updated

Source

fn on_finish(&self)

Called when the ProgressBar which holds the instance of Self is dropped

§Notes

Self::on_update() is NOT automatically called before finish, if you would like to update before the renderer is dropped, you can do so when defining this function

Implementors§