pub struct SectionRelaxDeltas { /* private fields */ }Expand description
Tracks all relaxation-induced byte deletions for a single section.
Implementations§
Source§impl SectionRelaxDeltas
impl SectionRelaxDeltas
pub fn new(raw: Vec<(u64, u32)>) -> Self
pub fn deltas(&self) -> &[RelaxDelta]
pub fn is_empty(&self) -> bool
pub fn total_deleted(&self) -> u64
Sourcepub fn merge_additional(&mut self, additional: Vec<(u64, u32)>)
pub fn merge_additional(&mut self, additional: Vec<(u64, u32)>)
Merges additional (input_offset, bytes_deleted) pairs into this set of deltas.
The additional pairs must not overlap with existing entries.
After merging, cumulative deleted counts are recomputed.
pub fn has_delta_at(&self, offset: u64) -> bool
Sourcepub fn delta_bytes_at(&self, offset: u64) -> u32
pub fn delta_bytes_at(&self, offset: u64) -> u32
Returns the number of bytes deleted at offset, or 0 if there is no delta at that offset.
pub fn input_to_output_offset(&self, input_offset: u64) -> u64
pub fn output_to_input_offset(&self, output_offset: u64) -> u64
pub fn cursor(&self) -> RelaxCursor<'_>
Trait Implementations§
Source§impl Clone for SectionRelaxDeltas
impl Clone for SectionRelaxDeltas
Source§fn clone(&self) -> SectionRelaxDeltas
fn clone(&self) -> SectionRelaxDeltas
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 moreSource§impl Debug for SectionRelaxDeltas
impl Debug for SectionRelaxDeltas
Source§impl Default for SectionRelaxDeltas
impl Default for SectionRelaxDeltas
Source§fn default() -> SectionRelaxDeltas
fn default() -> SectionRelaxDeltas
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SectionRelaxDeltas
impl RefUnwindSafe for SectionRelaxDeltas
impl Send for SectionRelaxDeltas
impl Sync for SectionRelaxDeltas
impl Unpin for SectionRelaxDeltas
impl UnsafeUnpin for SectionRelaxDeltas
impl UnwindSafe for SectionRelaxDeltas
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