pub struct GapTracker<const N: usize> { /* private fields */ }Expand description
Tracks unfilled gaps in a contiguous byte range.
Implementations§
Source§impl<const N: usize> GapTracker<N>
impl<const N: usize> GapTracker<N>
Sourcepub fn fill(&mut self, start: usize, end: usize)
pub fn fill(&mut self, start: usize, end: usize)
Mark the range [start, end) as filled, merging or splitting gaps.
Sourcepub fn is_complete_to(&self, offset: usize) -> bool
pub fn is_complete_to(&self, offset: usize) -> bool
Returns true if the range [0, offset) has no gaps.
Sourcepub fn shift(&mut self, amount: usize)
pub fn shift(&mut self, amount: usize)
Shift all offsets left by amount, discarding consumed data.
Sourcepub fn high_water(&self) -> usize
pub fn high_water(&self) -> usize
Returns the high-water mark.
Auto Trait Implementations§
impl<const N: usize> Freeze for GapTracker<N>
impl<const N: usize> RefUnwindSafe for GapTracker<N>
impl<const N: usize> Send for GapTracker<N>
impl<const N: usize> Sync for GapTracker<N>
impl<const N: usize> Unpin for GapTracker<N>
impl<const N: usize> UnsafeUnpin for GapTracker<N>
impl<const N: usize> UnwindSafe for GapTracker<N>
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