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: u64Implementations§
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.
Auto Trait Implementations§
impl Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnwindSafe for Progress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more