Struct progress::Progress [] [src]

pub struct Progress { /* fields omitted */ }

Tracks progress of a task.

There should be not more than a single instance started at a given point in time, it will mangle your terminal output.

Methods

impl Progress
[src]

[src]

[src]

[src]

Returns the current progress absolute value.

Example

use progress::Progress;
let p = Progress::default();
assert_eq!(0, p.current());

[src]

Returns the total value.

Example

use progress::Progress;
let p = Progress::default();
assert_eq!(100, p.total());

[src]

Advances the Progress by a certain amount.

Examplw

use progress::Progress;
let mut p = Progress::default();
assert_eq!(0, p.current());
p.forward(10);
assert_eq!(10, p.current());
p += 20;
assert_eq!(30, p.current());

[src]

Advances the Progress by a certain amount.

Examplw

use progress::Builder;
let mut p = Builder::new().set_start(30).build();
assert_eq!(30, p.current());
p.backward(10);
assert_eq!(20, p.current());
p -= 20;
assert_eq!(0, p.current());

[src]

Advances the Progress by exactly one.

[src]

Does a step backwards at the Progress.

[src]

Determines wheter a Progress has finished (reached the total) or not.

[src]

Returns the relative value of the Progress.

[src]

Activates the Progress.

[src]

Returns the current caption.

Trait Implementations

impl Default for Progress
[src]

[src]

Returns the "default value" for a type. Read more

impl AddAssign<usize> for Progress
[src]

[src]

Performs the += operation.

impl SubAssign<usize> for Progress
[src]

[src]

Performs the -= operation.