[−][src]Struct compact::CHashMap
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]
K: Copy,
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]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K: Copy + Eq + Hash, V: Compact, A: Allocator> Compact for OpenAddressingMap<K, V, A>
[src]
default fn is_still_compact(&self) -> bool
[src]
default fn dynamic_size_bytes(&self) -> usize
[src]
unsafe default fn compact(
source: *mut Self,
dest: *mut Self,
new_dynamic_part: *mut u8
)
[src]
source: *mut Self,
dest: *mut Self,
new_dynamic_part: *mut u8
)
unsafe fn decompact(source: *const Self) -> OpenAddressingMap<K, V, A>
[src]
fn total_size_bytes(&self) -> usize
[src]
unsafe fn behind(ptr: *mut Self) -> *mut u8
[src]
unsafe fn compact_behind(source: *mut Self, dest: *mut Self)
[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,
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,
A: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,