pub struct PendingBatch<T> {
items: Vec<T>,
total_rows: usize,
first_submitted_at: Option<Instant>,
}Expand description
Accumulates complete submissions in arrival order, without interpreting their data.
Fields§
§items: Vec<T>§total_rows: usize§first_submitted_at: Option<Instant>Implementations§
Source§impl<T> PendingBatch<T>
impl<T> PendingBatch<T>
Sourcepub fn push(&mut self, item: T, total_rows: usize, now: Instant)
pub fn push(&mut self, item: T, total_rows: usize, now: Instant)
Appends a complete submission without moving the first submission’s timestamp.
Sourcepub fn total_rows(&self) -> usize
pub fn total_rows(&self) -> usize
Returns the accumulated row count, saturated at usize::MAX.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether there are no submissions, including zero-row submissions.
Sourcepub fn first_submitted_at(&self) -> Option<Instant>
pub fn first_submitted_at(&self) -> Option<Instant>
Returns the time the first submission was appended to the current batch.
Trait Implementations§
Source§impl<T: Debug> Debug for PendingBatch<T>
impl<T: Debug> Debug for PendingBatch<T>
Auto Trait Implementations§
impl<T> Freeze for PendingBatch<T>
impl<T> RefUnwindSafe for PendingBatch<T>where
T: RefUnwindSafe,
impl<T> Send for PendingBatch<T>where
T: Send,
impl<T> Sync for PendingBatch<T>where
T: Sync,
impl<T> Unpin for PendingBatch<T>where
T: Unpin,
impl<T> UnsafeUnpin for PendingBatch<T>
impl<T> UnwindSafe for PendingBatch<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