pub struct Size {
pub bits: u16,
pub refs: u8,
}
Expand description
A size of a cell.
Fields§
§bits: u16
Total number of bits in cell slice.
refs: u8
Total number refs in cell slice.
Implementations§
Source§impl Size
impl Size
Sourcepub const fn fits_into_cell(&self) -> bool
pub const fn fits_into_cell(&self) -> bool
Returns true if the number of bits and refs is in the valid range for the cell.
Sourcepub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_add(self, rhs: Self) -> Self
Saturating size addition. Computes self + rhs for bits and refs, saturating at the numeric bounds instead of overflowing.
Sourcepub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
Saturating size substraction. Computes self - rhs for bits and refs, saturating at the numeric bounds instead of overflowing.
Trait Implementations§
Source§impl Add<Size> for CellTreeStats
impl Add<Size> for CellTreeStats
Source§impl AddAssign<Size> for CellTreeStats
impl AddAssign<Size> for CellTreeStats
Source§fn add_assign(&mut self, rhs: Size)
fn add_assign(&mut self, rhs: Size)
Performs the
+=
operation. Read moreSource§impl AddAssign for Size
impl AddAssign for Size
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl From<Size> for CellTreeStats
impl From<Size> for CellTreeStats
Source§impl SubAssign<Size> for CellTreeStats
impl SubAssign<Size> for CellTreeStats
Source§fn sub_assign(&mut self, rhs: Size)
fn sub_assign(&mut self, rhs: Size)
Performs the
-=
operation. Read moreSource§impl SubAssign for Size
impl SubAssign for Size
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl Copy for Size
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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.