pub struct ChunkProgress { /* private fields */ }Expand description
Mutable, invariant-preserving progress for one bounded chunk.
Implementations§
Source§impl ChunkProgress
impl ChunkProgress
Sourcepub fn from_counts(
size: ChunkSize,
counts: ChunkCounts,
) -> Result<Self, ChunkError>
pub fn from_counts( size: ChunkSize, counts: ChunkCounts, ) -> Result<Self, ChunkError>
Restores a validated in-memory progress snapshot.
§Errors
Returns ChunkError::SizeExceeded when counts.read() exceeds the
configured chunk size.
Sourcepub const fn counts(self) -> ChunkCounts
pub const fn counts(self) -> ChunkCounts
Returns the current validated counts.
Sourcepub fn record_read(&mut self) -> Result<(), ChunkError>
pub fn record_read(&mut self) -> Result<(), ChunkError>
Records one successfully read item.
§Errors
Returns ChunkError::SizeExceeded when the chunk is already full,
or ChunkError::CountOverflow on arithmetic exhaustion.
Sourcepub fn record_processed(&mut self) -> Result<(), ChunkError>
pub fn record_processed(&mut self) -> Result<(), ChunkError>
Classifies one previously read item as successfully processed.
§Errors
Returns ChunkError::ClassifiedExceedsRead when no unclassified read
item remains, or ChunkError::CountOverflow on exhaustion.
Sourcepub fn record_filtered(&mut self) -> Result<(), ChunkError>
pub fn record_filtered(&mut self) -> Result<(), ChunkError>
Classifies one previously read item as filtered.
§Errors
Returns ChunkError::ClassifiedExceedsRead when no unclassified read
item remains, or ChunkError::CountOverflow on exhaustion.
Sourcepub fn record_written(&mut self, count: ChunkCount) -> Result<(), ChunkError>
pub fn record_written(&mut self, count: ChunkCount) -> Result<(), ChunkError>
Records writer acknowledgement for count processed items.
§Errors
Returns ChunkError::WrittenExceedsProcessed when the aggregate
exceeds processed output, or ChunkError::CountOverflow on
exhaustion.
Trait Implementations§
Source§impl Clone for ChunkProgress
impl Clone for ChunkProgress
Source§fn clone(&self) -> ChunkProgress
fn clone(&self) -> ChunkProgress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more