pub struct Progress { /* private fields */ }
Expand description

A progress bar “coordinator” to share between threads.

Implementations

Initialize a new progress bar coordinator.

Like Progress::new but accepts a size hint to avoid reallocation as bar count grows.

Create a new progress bar with default styling and receive an owned handle to it.

Panics

Passing 0 to this function will cause a panic the first time a draw is attempted.

Set a particular Bar’s progress value, but don’t draw it.

Force the drawing of a particular Bar.

Note 1: Drawing will only occur if there is something meaningful to show. Namely, if the progress has advanced at least 1% since the last draw.

Note 2: If your program is not being run in a terminal, an initial empty bar will be printed but never refreshed.

Set a Bar’s value and immediately try to draw it.

Increment a given Bar’s progress, but don’t draw it.

Increment a given Bar’s progress and immediately try to draw it.

Has the given bar completed?

Cancel the given bar, say in the case of download failure, etc.

This fills the bar with the “cancel” character and consumes Bar ownership so that the bar cannot be manipulated again.

Return a handle to write above all progress bars.

When the handle is dropped all progress bars are redrawn.

Examples
use std::fmt::Write;

writeln!(progress.stderr(), "Some log message");

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.