pub struct Progress { /* private fields */ }Expand description
Counter shared between a reference algorithm (which bumps it) and a caller (which polls it for streaming progression).
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty progress with total = 0. The reference algorithm will set the
real total via Self::set_total once it knows the problem shape.
Sourcepub fn with_total(total: u64) -> Self
pub fn with_total(total: u64) -> Self
Pre-declared total: caller already knows the count and just wants to
poll. References still call Self::set_total on entry, which is a
no-op when the value matches.
Sourcepub fn set_total(&self, total: u64)
pub fn set_total(&self, total: u64)
Declare the total number of output writes. Called by the reference
algorithm at entry, before the first Self::bump.
Sourcepub fn bump_by(&self, n: u64)
pub fn bump_by(&self, n: u64)
Increment the counter by n output writes — useful when a reference
writes a contiguous run of outputs in one inner loop.
pub fn total(&self) -> u64
pub fn current(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Progress
impl RefUnwindSafe for Progress
impl Send for Progress
impl Sync for Progress
impl Unpin for Progress
impl UnsafeUnpin 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