Struct InnerNodeStats

Source
pub struct InnerNodeStats {
    pub count: usize,
    pub total_slots: usize,
    pub sum_slots: usize,
    pub total_header_bytes: usize,
    pub sum_prefix_len_bytes: usize,
    pub sum_capped_prefix_len_bytes: usize,
    pub max_prefix_len_bytes: usize,
    pub mem_usage: usize,
}
Expand description

Statistics for inner nodes

Fields§

§count: usize

The number of occurrences

§total_slots: usize

The total number of slots in inner nodes

§sum_slots: usize

The number of used slots in inner nodes

§total_header_bytes: usize

Sum of all header prefix lengths

§sum_prefix_len_bytes: usize

Sum of all used prefix length

§sum_capped_prefix_len_bytes: usize

Sum of all used prefix length capped to the maximum number of bytes in the header

§max_prefix_len_bytes: usize

Maximum prefix length in bytes

§mem_usage: usize

Total memory usage in bytes

Implementations§

Source§

impl InnerNodeStats

Source

fn aggregate_data<K, V, const PREFIX_LEN: usize, N>(&mut self, t: &N)
where N: InnerNode<PREFIX_LEN, Key = K, Value = V>,

Source

pub fn free_slots(&self) -> usize

How many free slots

Source

pub fn percentage_slots(&self) -> f64

Percentage of the maximum slots that is being used

Source

pub fn avg_prefix_len(&self) -> f64

The average prefix length

Source

pub fn avg_capped_prefix_len(&self) -> f64

The average prefix length but capped to the header prefix length

Source

pub fn free_header_bytes(&self) -> usize

The average prefix length but capped to the header prefix length

Source

pub fn percentage_header_bytes(&self) -> f64

The average prefix length but capped to the header prefix length

Source

pub fn node_size(&self) -> Option<usize>

Gets the node size in bytes, if the node count is 0, than this method returns None

Trait Implementations§

Source§

impl Add for InnerNodeStats

Source§

type Output = InnerNodeStats

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for InnerNodeStats

Source§

fn clone(&self) -> InnerNodeStats

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InnerNodeStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InnerNodeStats

Source§

fn default() -> InnerNodeStats

Returns the “default value” for a type. Read more
Source§

impl Hash for InnerNodeStats

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for InnerNodeStats

Source§

fn eq(&self, other: &InnerNodeStats) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for InnerNodeStats

Source§

impl Eq for InnerNodeStats

Source§

impl StructuralPartialEq for InnerNodeStats

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.