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

Progress bar to be rendered on the terminal.

Example

use zzz::prelude::*;

let mut bar = ProgressBar::with_target(123);
for _ in 0..123 {
    bar.add(1);
}

Implementations

Constructors.

Creates a smart progress bar, attempting to infer the target from size hints.

Creates a spinner, a progress bar with indeterminate target value.

Creates a progress bar with an explicit target value.

Builder-style methods.

Replace the config of the progress bar.

Force display as a spinner even if size hints are present.

Set the unit to be used when formatting values.

Value manipulation and access.

Set the progress bar value to a new, absolute value.

This doesn’t automatically redraw the progress-bar.

See set_sync for a thread-safe version.

Synchronized version fo set.

Add n to the value of the progress bar.

See add_sync for a thread-safe version.

Synchronized version fo add.

How often has the value been changed since creation?

Get the current value of the progress bar.

Get the current task description text.

Set the current task description text.

Synchronized version for set_message.

Calculate the current progress, 0.0 .. 1.0.

Calculate the elapsed time since creation of the progress bar.

Estimate the duration until completion.

Calculate the mean iterations per second since creation of the progress bar.

Calculate the mean progress bar updates per second since creation of the progress bar.

Calculates the progress of a rolling timer.

Returned values are always between 0 and 1. Timers are calculated from the start of the progress bar.

Forces a redraw of the progress bar.

Trait Implementations

Executes the destructor for this 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.