[][src]Struct ccl::nestedmap::NestedMap

pub struct NestedMap<K: Hash + Eq, V> { /* fields omitted */ }

NestedMap is a threadsafe concurrent hashmap with generally good performance.

The primary difference compared to DHashMap is that NestedMap is lockfree and non-blocking which makes it more appealing for latency critical things. It also has faster reads that DHashMap.

Methods

impl<'a, K: 'a + Hash + Eq, V: 'a> NestedMap<K, V>[src]

pub fn new() -> Self[src]

Create a new completely empty map.

pub fn new_layer_prefill() -> Self[src]

Create a new map but the root table is prefilled. This may make rapid initial growth more efficient.

pub fn insert(&self, key: K, value: V)[src]

Insert a value into the map.

pub fn insert_with_guard(&self, key: K, value: V, guard: &Guard)[src]

Insert a value into the map with an existing guard, saving on guard creation.

pub fn get(&'a self, key: &K) -> Option<TableRef<'a, K, V>>[src]

Get a reference to a value in the map.

pub fn get_with_guard(
    &'a self,
    key: &K,
    guard: Guard
) -> Option<TableRef<'a, K, V>>
[src]

Get a value from the map with an existing guard, saving on guard cration.

pub fn remove(&self, key: &K)[src]

Remove an item from the map.

pub fn remove_with_guard(&self, key: &K, guard: &Guard)[src]

Remove an item from the map with an existing guard, saving on guard creation.

pub fn contains_key(&self, key: &K) -> bool[src]

Check if the map contains a given key.

Important traits for TableIter<'a, K, V>
pub fn iter(&'a self) -> TableIter<'a, K, V>[src]

Iterate over all items in a map.

pub fn len(&self) -> usize[src]

Get the amount of elements in the map.

pub fn is_empty(&self) -> bool[src]

Check if the map is empty.

pub fn entry(&'a self, key: K) -> Entry<'a, K, V>[src]

Get an entry from the map.

pub fn extend<I: IntoIterator<Item = (K, V)>>(&self, iter: I)[src]

Extend the map with an iterator.

Trait Implementations

impl<'a, K: 'a + Hash + Eq, V: 'a> Default for NestedMap<K, V>[src]

impl<'a, K: 'a + Hash + Eq, V: 'a> Debug for NestedMap<K, V>[src]

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]