pub struct Counter(/* private fields */);Implementations§
Source§impl Counter
impl Counter
pub fn incr(&self)
pub fn add(&self, n: u64)
Sourcepub fn sync(&self, total: u64)
pub fn sync(&self, total: u64)
Adopt a total that is counted somewhere else.
For a counter whose authoritative value lives outside this struct: the shared dataflow
counts its own releases, and this exports that number rather than counting the same events a
second time. Still monotone, because the source is — but incr/add and this must not be
mixed on one counter, or neither is right.
pub fn get(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Counter
impl RefUnwindSafe for Counter
impl Send for Counter
impl Sync for Counter
impl Unpin for Counter
impl UnwindSafe for Counter
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