Struct stdcli::term::ProgressBar [] [src]

pub struct ProgressBar { /* fields omitted */ }

A progress bar or spinner.

Methods

impl ProgressBar
[src]

[src]

Creates a new progress bar with a given length.

This progress bar by default draws directly to stderr.

[src]

Creates a completely hidden progress bar.

This progress bar still responds to API changes but it does not have a length or render in any way.

[src]

Creates a new spinner.

This spinner by default draws directly to stdout. This adds the default spinner style to it.

[src]

Overrides the stored style.

[src]

Spawns a background thread to tick the progress bar.

When this is enabled a background thread will regularly tick the progress back in the given interval (milliseconds). This is useful to advance progress bars that are very slow by themselves.

When steady ticks are enabled calling .tick() on a progress bar does not do anything.

[src]

Undoes enable_steady_tick.

[src]

Manually ticks the spinner or progress bar.

This automatically happens on any other change to a progress bar.

[src]

Advances the position of a progress bar by delta.

[src]

Sets the position of the progress bar.

[src]

Sets the length of the progress bar.

[src]

Sets the current prefix of the progress bar.

[src]

Sets the current message of the progress bar.

[src]

Finishes the progress bar and leaves the current message.

[src]

Finishes the progress bar and sets a message.

[src]

Finishes the progress bar and completely clears it.

[src]

Sets a different draw target for the progress bar.

This can be used to draw the progress bar to stderr for instance:

let pb = ProgressBar::new(100);
pb.set_draw_target(ProgressDrawTarget::stderr());

[src]

Wraps an iterator with the progress bar.

let v = vec![1, 2, 3];
let pb = ProgressBar::new(3);
for item in pb.wrap_iter(v.iter()) {
    // ...
}

Trait Implementations

impl Drop for ProgressBar
[src]

[src]