Struct everscale_types::cell::LevelMask
source · pub struct LevelMask(_);Expand description
de Brujn level presence bitset.
Implementations§
source§impl LevelMask
impl LevelMask
sourcepub const unsafe fn new_unchecked(mask: u8) -> Self
pub const unsafe fn new_unchecked(mask: u8) -> Self
Constructs a new level mask from the provided byte as is.
Safety
The following must be true:
- Mask must be in range
0b000..=0b111.
sourcepub const fn from_level(level: u8) -> Self
pub const fn from_level(level: u8) -> Self
Creates a sufficient mask for the specified level.
NOTE: levels > 3 has no effect (mask will always be 0b111).
sourcepub const fn hash_index(self, level: u8) -> u8
pub const fn hash_index(self, level: u8) -> u8
Computes hash index for the specified level.
sourcepub const fn virtualize(self, offset: u8) -> Self
pub const fn virtualize(self, offset: u8) -> Self
Creates a new mask, shifted by the offset.
Trait Implementations§
source§impl BitOrAssign<LevelMask> for LevelMask
impl BitOrAssign<LevelMask> for LevelMask
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read more