pub struct Consumer<'a> { /* private fields */ }Expand description
The sole taking handle for a CountedSignal.
This handle is Send + !Sync and may atomically take counts while its
paired producer increments from another context.
ⓘ
use ph_eventing::counted_signal::Consumer;
fn assert_sync<T: Sync>() {}
assert_sync::<Consumer<'static>>();Implementations§
Source§impl Consumer<'_>
impl Consumer<'_>
Sourcepub fn take_count(&self) -> CountSnapshot
pub fn take_count(&self) -> CountSnapshot
Atomically take the count accumulated since the preceding take.
A concurrent increment belongs wholly to this snapshot or wholly to
the next one. CountSnapshot::is_saturated distinguishes the
saturation sentinel from an exact count.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Consumer<'a>
impl<'a> !Sync for Consumer<'a>
impl<'a> Freeze for Consumer<'a>
impl<'a> Send for Consumer<'a>
impl<'a> Unpin for Consumer<'a>
impl<'a> UnsafeUnpin for Consumer<'a>
impl<'a> UnwindSafe for Consumer<'a>
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