pub struct LevelMask(/* private fields */);
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 contains(self, level: u8) -> bool
pub const fn contains(self, level: u8) -> bool
Returns whether the specified level is included into the mask.
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 for LevelMask
impl BitOrAssign for LevelMask
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moreSource§impl IntoIterator for LevelMask
impl IntoIterator for LevelMask
impl Copy for LevelMask
impl Eq for LevelMask
impl StructuralPartialEq for LevelMask
Auto Trait Implementations§
impl Freeze for LevelMask
impl RefUnwindSafe for LevelMask
impl Send for LevelMask
impl Sync for LevelMask
impl Unpin for LevelMask
impl UnwindSafe for LevelMask
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
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
Compares
self
to key
and returns true
if they are equal.