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);
fn on_notify(&self, msg: String);
fn set_label(&self, msg: &str);
}Expand description
Defines how a progress bar should be rendered
Required Methods§
Sourcefn on_start(&self, value: usize, max: usize)
fn on_start(&self, value: usize, max: usize)
Called when the crate::ProgressBar which holds the instance of Self is spawned
Sourcefn on_update(&self, value: usize, max: usize)
fn on_update(&self, value: usize, max: usize)
Called when the crate::ProgressBar which holds the instance of Self is updated
Sourcefn on_finish(&self)
fn on_finish(&self)
Called when the crate::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
Sourcefn on_notify(&self, msg: String)
fn on_notify(&self, msg: String)
Generic notification. Can be sent from anything with access to the crate::ProgressBar that holds the instance of Self
This function is not called internally by anything, its meant for other libraries to call when they want to notify your renderer of some message. If you do not care, you can ignore this function
Sourcefn set_label(&self, msg: &str)
fn set_label(&self, msg: &str)
Sets the label of Self. Can be sent from anything with access to the crate::ProgressBar that holds the instance of Self
This function is not called internally by anything, its meant for other libraries to call when they want to label your progress bar. If you do not care, you can ignore this function