Struct everscale_types::cell::CellDescriptor
source · Expand description
Tightly packed info about a cell.
Fields§
§d1: u8First descriptor byte with a generic info about cell.
d2: u8Second descriptor byte with a packed data size.
Implementations§
source§impl CellDescriptor
impl CellDescriptor
pub const REF_COUNT_MASK: u8 = 7u8
pub const IS_EXOTIC_MASK: u8 = 8u8
pub const STORE_HASHES_MASK: u8 = 16u8
pub const LEVEL_MASK: u8 = 224u8
sourcepub const fn compute_d1(
level_mask: LevelMask,
is_exotic: bool,
ref_count: u8
) -> u8
pub const fn compute_d1(
level_mask: LevelMask,
is_exotic: bool,
ref_count: u8
) -> u8
Computes d1 descriptor byte from parts
sourcepub const fn compute_d2(bit_len: u16) -> u8
pub const fn compute_d2(bit_len: u16) -> u8
Computes d2 descriptor byte from cell length in bits
sourcepub const fn reference_count(self) -> u8
pub const fn reference_count(self) -> u8
Computes child cell count.
sourcepub const fn hash_count(self) -> u8
pub const fn hash_count(self) -> u8
Computes hash count.
NOTE: Guaranteed to be in range 1..=4.
sourcepub const fn is_pruned_branch(self) -> bool
pub const fn is_pruned_branch(self) -> bool
Returns whether this cell is a pruned branch cell
sourcepub const fn store_hashes(self) -> bool
pub const fn store_hashes(self) -> bool
Returns whether this cell should store hashes in data.
sourcepub const fn level_mask(self) -> LevelMask
pub const fn level_mask(self) -> LevelMask
Computes level mask.
sourcepub const fn is_aligned(self) -> bool
pub const fn is_aligned(self) -> bool
Returns whether this cell’s data is 8-bit aligned.
Trait Implementations§
source§impl Clone for CellDescriptor
impl Clone for CellDescriptor
source§fn clone(&self) -> CellDescriptor
fn clone(&self) -> CellDescriptor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more