pub struct ProgressBar { /* private fields */ }
Expand description
A progress bar renders progress indication. Supports spinner and download templates.
Can be used as a single progress bar and as part of a multi-progress bar
(see MultiProgress
).
Implemented via theming of indicatif::ProgressBar
.
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn with_spinner_template(self) -> Self
pub fn with_spinner_template(self) -> Self
Sets a default spinner visual template for the progress bar.
Sourcepub fn with_download_template(self) -> Self
pub fn with_download_template(self) -> Self
Sets a default visual template for downloading.
Sourcepub fn with_template(self, template: &str) -> Self
pub fn with_template(self, template: &str) -> Self
Sets a custom template string for the progress bar according to
indicatif::ProgressStyle
.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Indicates that the progress bar is finished.
Sourcepub fn set_message(&self, message: impl Display)
pub fn set_message(&self, message: impl Display)
Sets the current message of the progress bar
({msg}
placeholder must be present in the template if you’re using
a custom template via ProgressBar::with_template
).
Sourcepub fn set_length(&self, len: u64)
pub fn set_length(&self, len: u64)
Sets the length of the progress bar.
Sourcepub fn set_position(&self, pos: u64)
pub fn set_position(&self, pos: u64)
Sets the position of the progress bar.
Trait Implementations§
Source§impl Clone for ProgressBar
impl Clone for ProgressBar
Source§fn clone(&self) -> ProgressBar
fn clone(&self) -> ProgressBar
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnwindSafe for ProgressBar
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more