Struct starlark::collections::small_map::SmallMap [−][src]
#[repr(C)]pub struct SmallMap<K, V> { /* fields omitted */ }
Expand description
An memory-efficient key-value map with determinstic order.
Provides the standard container operations, modelled most closely on IndexMap
, plus:
-
Variants which take an already hashed value, e.g.
get_hashed
. -
Functions which work with the position, e.g.
get_index_of
.
Implementations
pub fn into_iter(self) -> MHIntoIter<K, V>ⓘNotable traits for MHIntoIter<K, V>impl<K, V> Iterator for MHIntoIter<K, V> type Item = (K, V);
Notable traits for MHIntoIter<K, V>
impl<K, V> Iterator for MHIntoIter<K, V> type Item = (K, V);
pub fn get_hashed<Q: ?Sized>(&self, key: BorrowHashed<'_, Q>) -> Option<&V> where
Q: Equivalent<K> + ?Sized,
K: Eq,
pub fn get_full<Q: ?Sized>(&self, key: &Q) -> Option<(usize, &K, &V)> where
Q: Hash + Equivalent<K> + ?Sized,
K: Eq,
pub fn get_index_of_hashed<Q: ?Sized>(
&self,
key: BorrowHashed<'_, Q>
) -> Option<usize> where
Q: Equivalent<K> + ?Sized,
K: Eq,
pub fn get_index_of<Q: ?Sized>(&self, key: &Q) -> Option<usize> where
Q: Hash + Equivalent<K> + ?Sized,
K: Eq,
pub fn get_mut_hashed<Q: ?Sized>(
&mut self,
key: BorrowHashed<'_, Q>
) -> Option<&mut V> where
Q: Equivalent<K> + ?Sized,
K: Eq,
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where
Q: Hash + Equivalent<K> + ?Sized,
K: Eq,
pub fn contains_key_hashed<Q: ?Sized>(&self, key: BorrowHashed<'_, Q>) -> bool where
Q: Equivalent<K> + ?Sized,
K: Eq,
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
Q: Hash + Equivalent<K> + ?Sized,
K: Eq,
pub fn remove_hashed<Q: ?Sized>(
&mut self,
key: BorrowHashed<'_, Q>
) -> Option<V> where
Q: ?Sized + Equivalent<K>,
K: Eq,
pub fn remove_hashed_entry<Q: ?Sized>(
&mut self,
key: BorrowHashed<'_, Q>
) -> Option<(K, V)> where
Q: ?Sized + Equivalent<K>,
K: Eq,
pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where
Q: ?Sized + Hash + Equivalent<K>,
K: Eq,
pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)> where
Q: ?Sized + Hash + Equivalent<K>,
K: Eq,
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<'v, K: UnpackValue<'v> + Hash + Eq, V: UnpackValue<'v>> UnpackValue<'v> for SmallMap<K, V>
impl<'v, K: UnpackValue<'v> + Hash + Eq, V: UnpackValue<'v>> UnpackValue<'v> for SmallMap<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for SmallMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> UnwindSafe for SmallMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.