pub struct ProgressBar { /* private fields */ }Expand description
A thread safe, thread stable progress bar, abstracted for any frontend
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn flush(&self)
pub fn flush(&self)
Waits until the flush is processed, allowing you to wait until all previous events have been processed
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
Sourcepub fn get_max(&self) -> usize
pub fn get_max(&self) -> usize
Gets the max value of the internal ProgressHandle
§Notes
While this will return the correct max value at time of call, In multi-threaded contexts, this max may have already changed by the time it has been used
Sourcepub fn get_value(&self) -> usize
pub fn get_value(&self) -> usize
Gets the value of the internal ProgressHandle
§Notes
While this will return the correct value at time of call, In multi-threaded contexts, this value may have already changed by the time it has been used
Sourcepub fn increment(&self)
pub fn increment(&self)
Increments the value of a progress bar by 1
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
Sourcepub fn new(
value: usize,
max: usize,
renderer: Arc<dyn ProgressRenderer>,
) -> ProgressBar
pub fn new( value: usize, max: usize, renderer: Arc<dyn ProgressRenderer>, ) -> ProgressBar
Creates a new progress bar instance using the renderer
This progress bar can safely be shared and updated between threads
Sourcepub fn set_max(&self, max: usize)
pub fn set_max(&self, max: usize)
Sets the max-value of the progress bar
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
Sourcepub fn set_value(&self, value: usize)
pub fn set_value(&self, value: usize)
Sets the value of the progress bar
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
Sourcepub fn update(&self)
pub fn update(&self)
Forces the ProgressRenderer to upate with the new values
§Panics
Panics if the progress bars handling thread cannot be communicated with.
Sourcepub fn set_label(&self, label: &str)
pub fn set_label(&self, label: &str)
Calls the ProgressRenderer::set_label() function for the held ProgressRenderer
Sourcepub fn notify(&self, message: impl ToString)
pub fn notify(&self, message: impl ToString)
Tells the handling thread to call the ProgressRenderer::on_notify() function for the held ProgressRenderer
§Panics
Panics if the progress bars handling thread cannot be communicated with.
Trait Implementations§
Source§impl Clone for ProgressBar
impl Clone for ProgressBar
Source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more