Struct indicatif::MultiProgress
source · pub struct MultiProgress { /* private fields */ }
Expand description
Manages multiple progress bars from different threads.
Implementations§
source§impl MultiProgress
impl MultiProgress
sourcepub fn new() -> MultiProgress
pub fn new() -> MultiProgress
Creates a new multi progress object that draws to stderr.
sourcepub fn set_draw_target(&self, target: ProgressDrawTarget)
pub fn set_draw_target(&self, target: ProgressDrawTarget)
Sets a different draw target for the multiprogress bar.
sourcepub fn set_move_cursor(&self, move_cursor: bool)
pub fn set_move_cursor(&self, move_cursor: bool)
Set whether we should try to move the cursor when possible instead of clearing lines.
This can reduce flickering, but do not enable it if you intend to change the number of progress bars.
sourcepub fn add(&self, bar: ProgressBar) -> ProgressBar
pub fn add(&self, bar: ProgressBar) -> ProgressBar
Adds a progress bar.
The progress bar added will have the draw target changed to a remote draw target that is intercepted by the multi progress object.
sourcepub fn join(&self) -> Result<()>
pub fn join(&self) -> Result<()>
Waits for all progress bars to report that they are finished.
You need to call this as this will request the draw instructions from the remote progress bars. Not calling this will deadlock your program.
sourcepub fn join_and_clear(&self) -> Result<()>
pub fn join_and_clear(&self) -> Result<()>
Works like join
but clears the progress bar in the end.