pub struct ProgressBar { /* private fields */ }Expand description
A single progress bar wrapping indicatif.
Implementations§
Source§impl ProgressBar
impl ProgressBar
Sourcepub fn new(total: u64, style: ProgressStyle) -> Self
pub fn new(total: u64, style: ProgressStyle) -> Self
Create a new progress bar with the given total and style.
Sourcepub fn set_prefix(&self, prefix: impl Into<String>)
pub fn set_prefix(&self, prefix: impl Into<String>)
Set the prefix text (typically appears before the bar).
Sourcepub fn set_style(&self, style: ProgressStyle)
pub fn set_style(&self, style: ProgressStyle)
Change the bar style.
Sourcepub fn set_message(&self, msg: impl Into<String>)
pub fn set_message(&self, msg: impl Into<String>)
Set the message text.
Sourcepub fn enable_steady_tick(&self, interval: Duration)
pub fn enable_steady_tick(&self, interval: Duration)
Enable steady tick (auto-redraw) at the given interval.
Sourcepub fn set_position(&self, pos: u64)
pub fn set_position(&self, pos: u64)
Set current position.
Sourcepub fn set_length(&self, len: u64)
pub fn set_length(&self, len: u64)
Set total length.
Sourcepub fn finish_with_message(&self, msg: impl Into<Cow<'static, str>>)
pub fn finish_with_message(&self, msg: impl Into<Cow<'static, str>>)
Mark as finished with a final message (bar stays visible).
Sourcepub fn finish_and_clear(&self)
pub fn finish_and_clear(&self)
Finish and clear from display.
Sourcepub const fn inner(&self) -> &IndicatifBar
pub const fn inner(&self) -> &IndicatifBar
Access the underlying indicatif bar.
Auto Trait Implementations§
impl Freeze for ProgressBar
impl RefUnwindSafe for ProgressBar
impl Send for ProgressBar
impl Sync for ProgressBar
impl Unpin for ProgressBar
impl UnsafeUnpin 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