Struct rustc_data_structures::stable_map::StableMap
source · [−]pub struct StableMap<K, V> {
base: FxHashMap<K, V>,
}Expand description
A deterministic wrapper around FxHashMap that does not provide iteration support.
It supports insert, remove, get and get_mut functions from FxHashMap.
It also allows to convert hashmap to a sorted vector with the method into_sorted_vector().
Fields
base: FxHashMap<K, V>Implementations
sourceimpl<K, V> StableMap<K, V> where
K: Eq + Hash,
impl<K, V> StableMap<K, V> where
K: Eq + Hash,
pub fn new() -> StableMap<K, V>
pub fn into_sorted_vector(self) -> Vec<(K, V)> where
K: Ord + Copy,
pub fn entry(&mut self, k: K) -> Entry<'_, K, V>
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
pub fn insert(&mut self, k: K, v: V) -> Option<V>
pub fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V> where
K: Borrow<Q>,
Q: Hash + Eq,
Trait Implementations
impl<K, V> Eq for StableMap<K, V> where
K: Eq + Hash,
V: Eq,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for StableMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for StableMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for StableMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for StableMap<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for StableMap<K, V> where
K: 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
impl<'a, T> Captures<'a> for T where
T: ?Sized,
impl<T> Erased for T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes