pub struct ChunkProgress { /* private fields */ }Expand description
Mutable, invariant-preserving progress for one bounded chunk.
Implementations§
Source§impl ChunkProgress
impl ChunkProgress
Sourcepub const fn new(size: ChunkSize) -> ChunkProgress
pub const fn new(size: ChunkSize) -> ChunkProgress
Starts an empty chunk with a validated nonzero size.
Sourcepub fn from_counts(
size: ChunkSize,
counts: ChunkCounts,
) -> Result<ChunkProgress, ChunkError>
pub fn from_counts( size: ChunkSize, counts: ChunkCounts, ) -> Result<ChunkProgress, 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 moreimpl Copy for ChunkProgress
Source§impl Debug for ChunkProgress
impl Debug for ChunkProgress
impl Eq for ChunkProgress
Source§impl PartialEq for ChunkProgress
impl PartialEq for ChunkProgress
impl StructuralPartialEq for ChunkProgress
Auto Trait Implementations§
impl Freeze for ChunkProgress
impl RefUnwindSafe for ChunkProgress
impl Send for ChunkProgress
impl Sync for ChunkProgress
impl Unpin for ChunkProgress
impl UnsafeUnpin for ChunkProgress
impl UnwindSafe for ChunkProgress
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more