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 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 increment_and_run<P, Q>(&self, pre: Option<P>, post: Option<Q>)
pub fn increment_and_run<P, Q>(&self, pre: Option<P>, post: Option<Q>)
Increments the value of the progress bar by 1 and runs a pre-write and post-write closure
The pre closure, if some, will run before the value is incremented
The post closure, if some, will run after the value is incremented, and before ProgressRenderer::on_update() method is run
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
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_max_and_run<P, Q>(&self, max: usize, pre: Option<P>, post: Option<Q>)
pub fn set_max_and_run<P, Q>(&self, max: usize, pre: Option<P>, post: Option<Q>)
Sets the max-value of the progress bar and runs a pre-write and post-write closure
The pre closure, if some, will run before the value is incremented
The post closure, if some, will run after the value is incremented, and before ProgressRenderer::on_update() method is run
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
§Notes
If the any of the input closures panic, it will not kill the thread, it will instead log the error and ignore it
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 set_value_and_run<P, Q>(
&self,
value: usize,
pre: Option<P>,
post: Option<Q>,
)
pub fn set_value_and_run<P, Q>( &self, value: usize, pre: Option<P>, post: Option<Q>, )
Sets the value of the progress bar and runs a pre-write and post-write closure
The pre closure, if some, will run before the value is incremented
The post closure, if some, will run after the value is incremented, and before ProgressRenderer::on_update() method is run
§Panics
Panics if the internal GLOBAL_SENDER thread cannot be communicated with. This usually signals critical failure somewhere
§Notes
If the any of the input closures panic, it will not kill the thread, it will instead log the error and ignore it
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