pub struct EmitCollector<T> {
pub records: Vec<Record<T>>,
pub rejected: usize,
/* private fields */
}Expand description
An EmitRecord implementation that collects records into a Vec,
optionally reporting Flow::Blocked once a capacity is reached
(rejected records are counted, not stored) — for testing blocked-path
handling.
Fields§
§records: Vec<Record<T>>Records accepted so far.
rejected: usizeRecords rejected after the block threshold was reached.
Implementations§
Source§impl<T> EmitCollector<T>
impl<T> EmitCollector<T>
Sourcepub fn blocking_after(n: usize) -> Self
pub fn blocking_after(n: usize) -> Self
A collector that accepts n records, then rejects with
Flow::Blocked.
Trait Implementations§
Source§impl<T: Debug> Debug for EmitCollector<T>
impl<T: Debug> Debug for EmitCollector<T>
Source§impl<T: Default> Default for EmitCollector<T>
impl<T: Default> Default for EmitCollector<T>
Source§fn default() -> EmitCollector<T>
fn default() -> EmitCollector<T>
Returns the “default value” for a type. Read more
Source§impl<'buf, T> EmitRecord<'buf, T> for EmitCollector<T>
impl<'buf, T> EmitRecord<'buf, T> for EmitCollector<T>
Auto Trait Implementations§
impl<T> Freeze for EmitCollector<T>
impl<T> RefUnwindSafe for EmitCollector<T>where
T: RefUnwindSafe,
impl<T> Send for EmitCollector<T>where
T: Send,
impl<T> Sync for EmitCollector<T>where
T: Sync,
impl<T> Unpin for EmitCollector<T>where
T: Unpin,
impl<T> UnsafeUnpin for EmitCollector<T>
impl<T> UnwindSafe for EmitCollector<T>where
T: UnwindSafe,
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