pub struct ProgressBar {
pub total_steps: usize,
pub current: usize,
pub label: Option<String>,
pub style: ProgressStyle,
pub total_bytes: Option<u64>,
pub bytes_processed: u64,
/* private fields */
}Expand description
Struct-based progress bar
Fields§
§total_steps: usize§current: usize§label: Option<String>§style: ProgressStyle§total_bytes: Option<u64>§bytes_processed: u64Implementations§
Source§impl ProgressBar
impl ProgressBar
pub fn new(total_steps: usize, style: ProgressStyle) -> Self
pub fn set_label(&mut self, label: &str)
pub fn set_progress(&mut self, value: usize)
pub fn tick(&mut self)
Sourcepub fn set_bytes_total(&mut self, total: u64)
pub fn set_bytes_total(&mut self, total: u64)
Set total bytes (enables byte-based progress). You may update processed bytes independently.
Sourcepub fn set_bytes_processed(&mut self, processed: u64)
pub fn set_bytes_processed(&mut self, processed: u64)
Set processed bytes; will render percent, rate, and ETA when total is known.
Sourcepub fn set_bytes(&mut self, total: u64, processed: u64)
pub fn set_bytes(&mut self, total: u64, processed: u64)
Convenience to set both total and processed bytes in one call.
pub fn start_auto(&mut self, duration_ms: u64)
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