pub struct TapSubscription { /* private fields */ }Expand description
One subscriber’s handle. Dropping it unsubscribes.
Implementations§
Source§impl TapSubscription
impl TapSubscription
Sourcepub fn take_batches(&self) -> Result<Vec<TapBatch>, TapError>
pub fn take_batches(&self) -> Result<Vec<TapBatch>, TapError>
Takes every held message as batches, one per run of messages admitted at the same divisor, oldest first, then halves the divisor (the subscriber has drained). The evictions since the previous take ride the first batch; with no messages and a nonzero eviction count, one empty batch carries it. With neither, nothing is returned.
§Errors
Returns TapError::Poisoned when the subscriber state is poisoned.
Sourcepub fn sample_one_in(&self) -> Result<NonZeroU32, TapError>
pub fn sample_one_in(&self) -> Result<NonZeroU32, TapError>
The current sampling divisor.
§Errors
Returns TapError::Poisoned when the subscriber state is poisoned.
Trait Implementations§
Source§impl Debug for TapSubscription
impl Debug for TapSubscription
Source§impl Drop for TapSubscription
impl Drop for TapSubscription
Auto Trait Implementations§
impl !RefUnwindSafe for TapSubscription
impl !UnwindSafe for TapSubscription
impl Freeze for TapSubscription
impl Send for TapSubscription
impl Sync for TapSubscription
impl Unpin for TapSubscription
impl UnsafeUnpin for TapSubscription
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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