Struct keylist::hash_keylist::HashKeylist
source · [−]pub struct HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher, { /* private fields */ }
Implementations
sourceimpl<K, V> HashKeylist<K, V, RandomState> where
K: Hash + Eq,
V: Eq,
impl<K, V> HashKeylist<K, V, RandomState> where
K: Hash + Eq,
V: Eq,
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
sourceimpl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
impl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
pub fn with_hasher(hash_builder: S) -> Self
pub fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self
pub fn iter(&self) -> Iter<'_, K, V>ⓘNotable traits for Iter<'a, K, V>impl<'a, K, V> Iterator for Iter<'a, K, V> where
K: Hash + Eq,
V: Eq, type Item = (&'a K, &'a V);
K: Hash + Eq,
V: Eq, type Item = (&'a K, &'a V);
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>ⓘNotable traits for IterMut<'a, K, V>impl<'a, K, V> Iterator for IterMut<'a, K, V> where
K: Hash + Eq,
V: Eq, type Item = (&'a K, &'a mut V);
K: Hash + Eq,
V: Eq, type Item = (&'a K, &'a mut V);
pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a K>
pub fn values<'a>(&'a self) -> impl Iterator<Item = &'a V>
pub fn values_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut V>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn pop(&mut self) -> Option<(K, V)>
pub fn remove(&mut self, index: usize) -> (K, V)
pub fn get_key_value(&self, key: &K) -> Option<(&K, &V)>
pub fn get(&self, key: &K) -> Option<&V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_all(&self, key: &K) -> Option<&Vec<V>>
sourcepub fn get_all_mut(&mut self, key: &K) -> Option<&mut Vec<V>>
pub fn get_all_mut(&mut self, key: &K) -> Option<&mut Vec<V>>
You probably only want to use this if you want to change the values in the list. Because if you push to the mutable list it won’t get added to the keys list, so for that case just use the push
function.
pub fn get_all_key_value<'a>(&'a self, key: &'a K) -> IterKeyValue<'a, K, V>ⓘNotable traits for IterKeyValue<'a, K, V>impl<'a, K, V> Iterator for IterKeyValue<'a, K, V> type Item = (&'a K, &'a V);
sourceimpl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq + Clone,
V: Eq,
S: BuildHasher,
impl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq + Clone,
V: Eq,
S: BuildHasher,
sourceimpl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq + Clone + Ord,
V: Eq,
S: BuildHasher,
impl<K, V, S> HashKeylist<K, V, S> where
K: Hash + Eq + Clone + Ord,
V: Eq,
S: BuildHasher,
pub fn sort_by_key<'a>(&'a mut self)
Trait Implementations
sourceimpl<K, V, S> Clone for HashKeylist<K, V, S> where
K: Hash + Eq + Clone,
V: Eq + Clone,
S: BuildHasher + Clone,
impl<K, V, S> Clone for HashKeylist<K, V, S> where
K: Hash + Eq + Clone,
V: Eq + Clone,
S: BuildHasher + Clone,
sourceimpl<K: Debug, V: Debug, S: Debug> Debug for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
impl<K: Debug, V: Debug, S: Debug> Debug for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
sourceimpl<K, V, S> Extend<(K, V)> for HashKeylist<K, V, S> where
K: Eq + Hash + Clone,
V: Eq,
S: BuildHasher,
impl<K, V, S> Extend<(K, V)> for HashKeylist<K, V, S> where
K: Eq + Hash + Clone,
V: Eq,
S: BuildHasher,
sourcefn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬 This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬 This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<K, V> From<HashKeylist<K, V, RandomState>> for Vec<(K, V)> where
K: Hash + Eq + Clone,
V: Eq,
impl<K, V> From<HashKeylist<K, V, RandomState>> for Vec<(K, V)> where
K: Hash + Eq + Clone,
V: Eq,
sourcefn from(input: HashKeylist<K, V, RandomState>) -> Vec<(K, V)>
fn from(input: HashKeylist<K, V, RandomState>) -> Vec<(K, V)>
Converts to this type from the input type.
sourceimpl<K, V> From<Vec<(K, V), Global>> for HashKeylist<K, V, RandomState> where
K: Hash + Eq + Clone,
V: Eq,
impl<K, V> From<Vec<(K, V), Global>> for HashKeylist<K, V, RandomState> where
K: Hash + Eq + Clone,
V: Eq,
sourceimpl<K, V> FromIterator<(K, V)> for HashKeylist<K, V, RandomState> where
K: Hash + Eq + Clone,
V: Eq,
impl<K, V> FromIterator<(K, V)> for HashKeylist<K, V, RandomState> where
K: Hash + Eq + Clone,
V: Eq,
sourcefn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl<'a, K, V, S> IntoIterator for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
impl<'a, K, V, S> IntoIterator for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
sourceimpl<K, V, S> PartialEq<HashKeylist<K, V, S>> for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
impl<K, V, S> PartialEq<HashKeylist<K, V, S>> for HashKeylist<K, V, S> where
K: Hash + Eq,
V: Eq,
S: BuildHasher,
Auto Trait Implementations
impl<K, V, S> RefUnwindSafe for HashKeylist<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> Send for HashKeylist<K, V, S> where
K: Send,
S: Send,
V: Send,
impl<K, V, S> Sync for HashKeylist<K, V, S> where
K: Sync,
S: Sync,
V: Sync,
impl<K, V, S> Unpin for HashKeylist<K, V, S> where
K: Unpin,
S: Unpin,
V: Unpin,
impl<K, V, S> UnwindSafe for HashKeylist<K, V, S> where
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more