Struct imhamt::node::reference::Node

source ·
pub struct Node<K, V> {
    pub bitmap: SmallBitmap,
    pub children: Box<[Arc<Entry<K, V>>]>,
}
Expand description

Node of the Hash Array Mapped Trie

The bitmap is indexed by a HashSubgroup and give an entry

Fields§

§bitmap: SmallBitmap§children: Box<[Arc<Entry<K, V>>]>

Implementations§

source§

impl<K, V> Node<K, V>

source

pub fn new() -> Self

source

pub fn singleton(idx: LevelIndex, child: Arc<Entry<K, V>>) -> Self

source

pub fn is_empty(&self) -> bool

source

pub fn number_children(&self) -> usize

source

pub fn get_child(&self, at: ArrayIndex) -> &Arc<Entry<K, V>>

source

pub fn set_at(&self, idx: LevelIndex, child: Arc<Entry<K, V>>) -> Self

source

pub fn clear_at(&self, idx: LevelIndex) -> Option<Self>

source

pub fn replace_at(&self, idx: ArrayIndex, child: Arc<Entry<K, V>>) -> Self

source

pub fn clear_or_replace_at( &self, idx: LevelIndex, child: Option<Arc<Entry<K, V>>> ) -> Option<Self>

source

pub fn iter(&self) -> Iter<'_, Arc<Entry<K, V>>>

Trait Implementations§

source§

impl<K: Clone, V: Clone> Clone for Node<K, V>

source§

fn clone(&self) -> Node<K, V>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<K: Debug, V: Debug> Debug for Node<K, V>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for Node<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V> Send for Node<K, V>where K: Send + Sync, V: Send + Sync,

§

impl<K, V> Sync for Node<K, V>where K: Send + Sync, V: Send + Sync,

§

impl<K, V> Unpin for Node<K, V>

§

impl<K, V> UnwindSafe for Node<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere T: Clone,

§

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