pub struct ChunkCounts { /* private fields */ }Expand description
Validated item counts within one open chunk.
Implementations§
Source§impl ChunkCounts
impl ChunkCounts
Sourcepub fn new(
read: ChunkCount,
processed: ChunkCount,
written: ChunkCount,
filtered: ChunkCount,
) -> Result<Self, ChunkError>
pub fn new( read: ChunkCount, processed: ChunkCount, written: ChunkCount, filtered: ChunkCount, ) -> Result<Self, ChunkError>
Validates a complete count snapshot.
processed counts items that produced writer input; filtered counts
items intentionally producing no output. Their sum cannot exceed
read, and written cannot exceed processed.
§Errors
Returns a typed overflow or invalid-state classification.
Sourcepub const fn read(self) -> ChunkCount
pub const fn read(self) -> ChunkCount
Returns the read count.
Sourcepub const fn processed(self) -> ChunkCount
pub const fn processed(self) -> ChunkCount
Returns the successfully processed count.
Sourcepub const fn written(self) -> ChunkCount
pub const fn written(self) -> ChunkCount
Returns the acknowledged writer-input count.
Sourcepub const fn filtered(self) -> ChunkCount
pub const fn filtered(self) -> ChunkCount
Returns the filtered count.
Sourcepub fn checked_add(self, other: Self) -> Result<Self, ChunkError>
pub fn checked_add(self, other: Self) -> Result<Self, ChunkError>
Adds two snapshots and revalidates their aggregate invariants.
§Errors
Returns a typed overflow or invalid-state classification.
Trait Implementations§
Source§impl Clone for ChunkCounts
impl Clone for ChunkCounts
Source§fn clone(&self) -> ChunkCounts
fn clone(&self) -> ChunkCounts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ChunkCounts
Source§impl Debug for ChunkCounts
impl Debug for ChunkCounts
Source§impl Default for ChunkCounts
impl Default for ChunkCounts
Source§fn default() -> ChunkCounts
fn default() -> ChunkCounts
Returns the “default value” for a type. Read more
impl Eq for ChunkCounts
Source§impl PartialEq for ChunkCounts
impl PartialEq for ChunkCounts
impl StructuralPartialEq for ChunkCounts
Auto Trait Implementations§
impl Freeze for ChunkCounts
impl RefUnwindSafe for ChunkCounts
impl Send for ChunkCounts
impl Sync for ChunkCounts
impl Unpin for ChunkCounts
impl UnsafeUnpin for ChunkCounts
impl UnwindSafe for ChunkCounts
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