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]
fn new<S: Into<String>>(caption: S, start: usize, end: usize) -> Self
[src]
fn new_with_width<S>(caption: S, start: usize, end: usize, width: u16) -> Self where
S: Into<String>,
[src]
S: Into<String>,
fn current(&self) -> usize
[src]
Returns the current progress absolute value.
Example
use progress::Progress; let p = Progress::default(); assert_eq!(0, p.current());
fn total(&self) -> usize
[src]
Returns the total value.
Example
use progress::Progress; let p = Progress::default(); assert_eq!(100, p.total());
fn forward(&mut self, step: usize) -> &Self
[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());
fn backward(&mut self, step: usize) -> &Self
[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());
fn increment(&mut self) -> &Self
[src]
Advances the Progress by exactly one.
fn decrement(&mut self) -> &Self
[src]
Does a step backwards at the Progress.
fn finished(&self) -> bool
[src]
Determines wheter a Progress has finished (reached the total) or not.
fn process(&self) -> u8
[src]
Returns the relative value of the Progress.
fn start(&mut self) -> &Self
[src]
Activates the Progress.
[src]
Returns the current caption.
Trait Implementations
impl Default for Progress
[src]
impl AddAssign<usize> for Progress
[src]
fn add_assign(&mut self, step: usize)
[src]
Performs the +=
operation.
impl SubAssign<usize> for Progress
[src]
fn sub_assign(&mut self, step: usize)
[src]
Performs the -=
operation.