pub struct Progress {
pub work_done: u64,
/* private fields */
}
Expand description
The struct holding the state and functions related to our progress.
Fields§
§work_done: u64
Implementations§
source§impl Progress
impl Progress
sourcepub fn inc_work_done(&mut self)
pub fn inc_work_done(&mut self)
Increment work done by one unit.
use pit_wall::Progress;
let mut progress = Progress::new("my job", 100);
progress.inc_work_done();
assert_eq!(progress.work_done, 1);
sourcepub fn inc_work_done_by(&mut self, units: u64)
pub fn inc_work_done_by(&mut self, units: u64)
Increment work done by a given amonut.
sourcepub fn set_work_done(&mut self, units: u64)
pub fn set_work_done(&mut self, units: u64)
Set work done.
sourcepub fn get_progress_string(&self) -> String
pub fn get_progress_string(&self) -> String
Returns a formatted string giving a bunch of information on the current progress. You may want to log this periodically with whatever logging you have set up.