[][src]Struct compact::CHashMap

pub struct CHashMap<K, V, A: Allocator = DefaultHeap> { /* fields omitted */ }

A dynamically-sized open adressing quadratic probing hashmap that can be stored in compact sequential storage and automatically spills over into free heap storage using Allocator.

Implementations

impl<K: Copy + Eq + Hash, V: Compact, A: Allocator> OpenAddressingMap<K, V, A>[src]

pub fn new() -> Self[src]

constructor

pub fn with_capacity(l: usize) -> Self[src]

constructor

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

Amount of entries in the dictionary

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

Is the dictionary empty?

pub fn get(&self, query: K) -> Option<&V>[src]

Look up the value for key query, if it exists

pub fn get_mut(&mut self, query: K) -> Option<&mut V>[src]

get mutable

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

Does the dictionary contain a value for query?

pub fn insert(&mut self, query: K, value: V) -> Option<V>[src]

Insert new value at key query and return the previous value at that key, if any existed

pub fn remove(&mut self, query: K) -> Option<V>[src]

Remove value at key query and return it, if it existed

pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K> + 'a[src]

Iterator over all keys in the dictionary

pub fn values<'a>(&'a self) -> impl Iterator<Item = &'a V> + 'a[src]

Iterator over all values in the dictionary

pub fn values_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V> + 'a[src]

Iterator over mutable references to all values in the dictionary

pub fn pairs<'a>(&'a self) -> impl Iterator<Item = (&'a K, &'a V)> + 'a[src]

Iterator over all key-value pairs in the dictionary

pub fn pairs_mut<'a>(&'a mut self) -> impl Iterator<Item = (K, &'a mut V)> + 'a where
    K: Copy
[src]

Iterator over all key-value pairs in the dictionary, with the value as a mutable reference

impl<K: Hash + Eq + Copy, I: Compact, A1: Allocator, A2: Allocator> OpenAddressingMap<K, CompactVec<I, A1>, A2>[src]

pub fn push_at(&mut self, query: K, item: I)[src]

Push a value onto the CompactVec at the key query

pub fn get_iter<'a>(&'a self, query: K) -> impl Iterator<Item = &'a I> + 'a[src]

Iterator over the CompactVec at the key query

pub fn remove_iter<'a>(&'a mut self, query: K) -> impl Iterator<Item = I> + 'a[src]

Remove the CompactVec at the key query and iterate over its elements (if it existed)

Trait Implementations

impl<K: Copy, V: Compact + Clone, A: Allocator> Clone for OpenAddressingMap<K, V, A>[src]

impl<K: Copy + Eq + Hash, V: Compact, A: Allocator> Compact for OpenAddressingMap<K, V, A>[src]

impl<K: Copy + Eq + Hash + Debug, V: Compact + Clone + Debug, A: Allocator> Debug for OpenAddressingMap<K, V, A>[src]

impl<K: Copy + Eq + Hash, V: Compact, A: Allocator> Default for OpenAddressingMap<K, V, A>[src]

impl<K: Copy + Eq + Hash, V: Compact + Clone, A: Allocator> FromIterator<(K, V)> for OpenAddressingMap<K, V, A>[src]

fn from_iter<T: IntoIterator<Item = (K, V)>>(iter_to_be: T) -> Self[src]

Construct a compact dictionary from an interator over key-value pairs

Auto Trait Implementations

impl<K, V, A> RefUnwindSafe for OpenAddressingMap<K, V, A> where
    A: RefUnwindSafe,
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V, A = DefaultHeap> !Send for OpenAddressingMap<K, V, A>

impl<K, V, A = DefaultHeap> !Sync for OpenAddressingMap<K, V, A>

impl<K, V, A> Unpin for OpenAddressingMap<K, V, A>

impl<K, V, A> UnwindSafe for OpenAddressingMap<K, V, A> where
    A: RefUnwindSafe,
    K: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.