Struct treap_map::Node

source ·
pub struct Node<C: TreapMapConfig> {
    pub key: C::SearchKey,
    pub value: C::Value,
    pub sort_key: C::SortKey,
    pub weight: C::Weight,
    /* private fields */
}
Expand description

A node in a treap-map data structure.

The Node struct represents a node in a treap-map and contains various key-value pairs and metadata required for the proper functioning and maintenance of the treap-map. Direct modification of these fields is not recommended outside of the TreapMap::update function, as this function correctly maintains the integrity of the treap-map.

Fields§

§key: C::SearchKey

The key exposed externally. Used for key-based searches within the treap-map.

§value: C::Value

The value stored in the node.

§sort_key: C::SortKey

The sorting key for the treap-map. If the type is (), the search_key is used for sorting.

§weight: C::Weight

The weight of the node, used by the treap-map to maintain accumulated weights.

Implementations§

source§

impl<C: TreapMapConfig> Node<C>

source

pub fn new( key: C::SearchKey, value: C::Value, sort_key: C::SortKey, weight: C::Weight, priority: u64 ) -> Node<C>

source

pub fn sum_weight(&self) -> C::Weight

Trait Implementations§

source§

impl<C: TreapMapConfig> MallocSizeOf for Node<C>
where C::SearchKey: MallocSizeOf, C::SortKey: MallocSizeOf, C::Value: MallocSizeOf, C::Weight: MallocSizeOf,

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.

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> 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V