pub struct CellSliceRange { /* private fields */ }
Expand description
Indices of the slice data and refs windows.
Implementations§
Source§impl CellSliceRange
impl CellSliceRange
Sourcepub fn apply<T>(self, cell: &T) -> Result<CellSlice<'_>, Error>
pub fn apply<T>(self, cell: &T) -> Result<CellSlice<'_>, Error>
Constructs a new cell slice from the specified cell using the current range. Returns an error if the cell is pruned.
NOTE: the resulting range will be truncated to cell bounds.
Sourcepub fn apply_allow_special<T>(self, cell: &T) -> CellSlice<'_>
pub fn apply_allow_special<T>(self, cell: &T) -> CellSlice<'_>
Constructs a new cell slice from the specified cell using the current range.
NOTE: the resulting range will be truncated to cell bounds.
§Safety
The following must be true:
- cell is not pruned
- range is in cell bounds
Sourcepub const fn size_bits(&self) -> u16
pub const fn size_bits(&self) -> u16
Returns the number of remaining bits of data in the slice.
Sourcepub const fn is_data_empty(&self) -> bool
pub const fn is_data_empty(&self) -> bool
Returns whether there are no bits of data left.
Sourcepub const fn is_refs_empty(&self) -> bool
pub const fn is_refs_empty(&self) -> bool
Returns whether there are no references left.
Sourcepub const fn offset_bits(&self) -> u16
pub const fn offset_bits(&self) -> u16
Returns the start of the data window.
Sourcepub const fn offset_refs(&self) -> u8
pub const fn offset_refs(&self) -> u8
Returns the start of the references window.
Sourcepub const fn has_remaining(&self, bits: u16, refs: u8) -> bool
pub const fn has_remaining(&self, bits: u16, refs: u8) -> bool
Returns true if the slice contains at least bits
and refs
.
Sourcepub fn skip_first(&mut self, bits: u16, refs: u8) -> Result<(), Error>
pub fn skip_first(&mut self, bits: u16, refs: u8) -> Result<(), Error>
Tries to advance the start of data and refs windows.
Sourcepub fn only_first(&mut self, bits: u16, refs: u8) -> Result<(), Error>
pub fn only_first(&mut self, bits: u16, refs: u8) -> Result<(), Error>
Leaves only the first bits
and refs
in the slice.
Sourcepub fn skip_last(&mut self, bits: u16, refs: u8) -> Result<(), Error>
pub fn skip_last(&mut self, bits: u16, refs: u8) -> Result<(), Error>
Removes the last bits
and refs
from the slice.
Sourcepub fn only_last(&mut self, bits: u16, refs: u8) -> Result<(), Error>
pub fn only_last(&mut self, bits: u16, refs: u8) -> Result<(), Error>
Leaves only the last bits
and refs
in the slice.
Sourcepub fn get_prefix(&self, bits: u16, refs: u8) -> Self
pub fn get_prefix(&self, bits: u16, refs: u8) -> Self
Returns a slice range starting at the same bits and refs offsets,
and containing no more than bits
of data and refs
of children.
Trait Implementations§
Source§impl Clone for CellSliceRange
impl Clone for CellSliceRange
Source§fn clone(&self) -> CellSliceRange
fn clone(&self) -> CellSliceRange
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CellSliceRange
impl Debug for CellSliceRange
Source§impl Default for CellSliceRange
impl Default for CellSliceRange
Source§fn default() -> CellSliceRange
fn default() -> CellSliceRange
Source§impl PartialEq for CellSliceRange
impl PartialEq for CellSliceRange
impl Copy for CellSliceRange
impl Eq for CellSliceRange
impl StructuralPartialEq for CellSliceRange
Auto Trait Implementations§
impl Freeze for CellSliceRange
impl RefUnwindSafe for CellSliceRange
impl Send for CellSliceRange
impl Sync for CellSliceRange
impl Unpin for CellSliceRange
impl UnwindSafe for CellSliceRange
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
self
to key
and returns true
if they are equal.