pub struct ProgressTracker { /* private fields */ }Implementations§
Source§impl ProgressTracker
impl ProgressTracker
pub fn with_callback(total: u64, callback: Option<ProgressFn>) -> Self
Sourcepub fn add(&self, value: u64)
pub fn add(&self, value: u64)
Add completed work, firing the callback if the threshold is crossed.
The counter is a relaxed atomic and the lock is only taken when there is a callback to fire — a tracker nobody is listening to costs one atomic add per locus.
Sourcepub fn done_report(&self)
pub fn done_report(&self)
Fire the callback with (total, total) unless 100% was already reported.
Called once all the work is finished, so a request always ends on a full bar however its windows fell.
pub fn done(&self) -> u64
pub fn total(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ProgressTracker
impl !RefUnwindSafe for ProgressTracker
impl !UnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnsafeUnpin for ProgressTracker
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more