Struct everscale_types::cell::slice::CellSlice
source · pub struct CellSlice<'a, C: CellFamily> { /* private fields */ }Expand description
A read-only view for a subcell of a cell
Implementations§
source§impl<'a, C: CellFamily> CellSlice<'a, C>
impl<'a, C: CellFamily> CellSlice<'a, C>
sourcepub fn level_mask(&self) -> LevelMask
pub fn level_mask(&self) -> LevelMask
Computes the level mask from the descriptor bytes.
sourcepub fn is_data_empty(&self) -> bool
pub fn is_data_empty(&self) -> bool
Returns whether there are no bits of data left.
sourcepub fn is_refs_empty(&self) -> bool
pub fn is_refs_empty(&self) -> bool
Returns whether threre are no references left.
sourcepub fn remaining_refs(&self) -> u8
pub fn remaining_refs(&self) -> u8
Returns the number of remaining references in the slice.
sourcepub fn remaining_bits(&self) -> u16
pub fn remaining_bits(&self) -> u16
Returns the number of remaining bits of data in the slice.
sourcepub fn bits_offset(&self) -> u16
pub fn bits_offset(&self) -> u16
Returns the start of the data window.
sourcepub fn try_advance(&mut self, bits: u16) -> bool
pub fn try_advance(&mut self, bits: u16) -> bool
Tries to advance the start of the data window,
returns false if bits is greater than the remainder.
sourcepub fn get_bit(&self, offset: u16) -> Option<bool>
pub fn get_bit(&self, offset: u16) -> Option<bool>
Tries to read the bit at the specified offset (relative to the current bits window).
sourcepub fn get_next_bit(&mut self) -> Option<bool>
pub fn get_next_bit(&mut self) -> Option<bool>
Tries to read the next bit, incrementing the bits window start.
sourcepub fn get_bits(&self, offset: u16, bits: u8) -> Option<u8>
pub fn get_bits(&self, offset: u16, bits: u8) -> Option<u8>
Returns a small subset of bits (0..=8) starting from the offset.
sourcepub fn get_next_bits(&mut self, bits: u8) -> Option<u8>
pub fn get_next_bits(&mut self, bits: u8) -> Option<u8>
Tries to read the next small subset of bits (0..=8), incrementing the bits window start.
sourcepub fn get_next_u8(&mut self) -> Option<u8>
pub fn get_next_u8(&mut self) -> Option<u8>
Tries to read the next u8, incrementing the bits window start.
sourcepub fn get_next_u16(&mut self) -> Option<u16>
pub fn get_next_u16(&mut self) -> Option<u16>
Tries to read the next u16, incrementing the bits window start.
sourcepub fn get_next_u32(&mut self) -> Option<u32>
pub fn get_next_u32(&mut self) -> Option<u32>
Tries to read the next u32, incrementing the bits window start.
sourcepub fn get_next_u64(&mut self) -> Option<u64>
pub fn get_next_u64(&mut self) -> Option<u64>
Tries to read the next u64, incrementing the bits window start.
sourcepub fn get_next_u128(&mut self) -> Option<u128>
pub fn get_next_u128(&mut self) -> Option<u128>
Tries to read the next u128, incrementing the bits window start.
sourcepub fn get_u256(&self, offset: u16) -> Option<[u8; 32]>
pub fn get_u256(&self, offset: u16) -> Option<[u8; 32]>
Reads 32 bytes starting from the offset.
sourcepub fn get_next_u256(&mut self) -> Option<[u8; 32]>
pub fn get_next_u256(&mut self) -> Option<[u8; 32]>
Tries to read the next 32 bytes, incrementing the bits window start.
sourcepub fn reference(&self, index: u8) -> Option<&dyn Cell<C>>
pub fn reference(&self, index: u8) -> Option<&dyn Cell<C>>
Returns a reference to the Nth child cell (relative to this slice’s refs window).
sourcepub fn reference_cloned(&self, index: u8) -> Option<CellContainer<C>>
pub fn reference_cloned(&self, index: u8) -> Option<CellContainer<C>>
Returns the Nth child cell (relative to this slice’s refs window).
sourcepub fn references(&self) -> RefsIter<'a, C> ⓘ
pub fn references(&self) -> RefsIter<'a, C> ⓘ
Creates an iterator through child nodes.
sourcepub fn into_references(self) -> RefsIter<'a, C> ⓘ
pub fn into_references(self) -> RefsIter<'a, C> ⓘ
Converts this slice into an iterator through child nodes.
sourcepub fn get_next_reference(&mut self) -> Option<&dyn Cell<C>>
pub fn get_next_reference(&mut self) -> Option<&dyn Cell<C>>
Returns a reference to the next child cell (relative to this slice’s refs window), incrementing the refs window start.
sourcepub fn get_next_reference_cloned(&mut self) -> Option<CellContainer<C>>
pub fn get_next_reference_cloned(&mut self) -> Option<CellContainer<C>>
Returns the next child cell (relative to this slice’s refs window), incrementing the refs window start.