pub struct Counter<T, P> { /* private fields */ }Expand description
A wrapper which updates shared produced based on the number of records pushed.
Implementations§
Source§impl<T, P> Counter<T, P>
impl<T, P> Counter<T, P>
Sourcepub fn new(pushee: P) -> Counter<T, P>
pub fn new(pushee: P) -> Counter<T, P>
Allocates a new Counter from a pushee and shared counts.
Sourcepub fn produced(&self) -> &Rc<RefCell<ChangeBatch<T>>>
pub fn produced(&self) -> &Rc<RefCell<ChangeBatch<T>>>
A references to shared changes in counts, for cloning or draining.
Sourcepub fn give<C: Container>(&mut self, time: T, container: &mut C)
pub fn give<C: Container>(&mut self, time: T, container: &mut C)
Ships a time and a container.
This is not a validated capability, and this method should not be used without great care.
Ideally, users would not have direct access to a Counter, and preventing this is the way
to uphold invariants.
Trait Implementations§
Auto Trait Implementations§
impl<T, P> Freeze for Counter<T, P>where
P: Freeze,
impl<T, P> !RefUnwindSafe for Counter<T, P>
impl<T, P> !Send for Counter<T, P>
impl<T, P> !Sync for Counter<T, P>
impl<T, P> Unpin for Counter<T, P>where
P: Unpin,
impl<T, P> !UnwindSafe for Counter<T, P>
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