pub struct Progress {
pub tasks: Vec<Task>,
pub auto_refresh: bool,
pub refresh_per_second: f64,
pub transient: bool,
pub columns: Option<Vec<Box<dyn ProgressColumn>>>,
/* private fields */
}Expand description
A multi-task progress display.
Fields§
§tasks: Vec<Task>§auto_refresh: bool§refresh_per_second: f64§transient: bool§columns: Option<Vec<Box<dyn ProgressColumn>>>Columns to render for each task (if None, uses default columns).
Implementations§
Source§impl Progress
impl Progress
pub fn new() -> Self
Sourcepub fn with_columns(self, columns: Vec<Box<dyn ProgressColumn>>) -> Self
pub fn with_columns(self, columns: Vec<Box<dyn ProgressColumn>>) -> Self
Set custom columns for rendering.
Sourcepub fn add_task(
&mut self,
description: impl Into<String>,
total: Option<f64>,
) -> usize
pub fn add_task( &mut self, description: impl Into<String>, total: Option<f64>, ) -> usize
Add a new task and return its ID.
Sourcepub fn remove_task(&mut self, task_id: usize)
pub fn remove_task(&mut self, task_id: usize)
Remove a completed task.
Sourcepub fn track<I: IntoIterator>(
&mut self,
sequence: I,
description: impl Into<String>,
total: Option<f64>,
) -> TrackIterator<I::IntoIter> ⓘ
pub fn track<I: IntoIterator>( &mut self, sequence: I, description: impl Into<String>, total: Option<f64>, ) -> TrackIterator<I::IntoIter> ⓘ
Add a track() method that wraps an iterator with progress tracking.
Equivalent to Python Rich’s track().
Sourcepub fn advance_bytes(&mut self, task_id: usize, bytes: u64)
pub fn advance_bytes(&mut self, task_id: usize, bytes: u64)
Advance a task by a number of bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Progress
impl !RefUnwindSafe for Progress
impl !Send for Progress
impl !Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin for Progress
impl !UnwindSafe for Progress
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