Struct rustc_data_structures::unord::UnordMap
source · Expand description
This is a map collection type that tries very hard to not expose any internal iteration. This is a useful property when trying to uphold the determinism invariants imposed by the query system.
This collection type is a good choice for map-like collections the keys of which don’t have a semantic ordering.
See MCP 533 for more information.
Fields
inner: FxHashMap<K, V>Implementations
sourceimpl<K: Eq + Hash, V> UnordMap<K, V>
impl<K: Eq + Hash, V> UnordMap<K, V>
pub fn len(&self) -> usize
pub fn insert(&mut self, k: K, v: V) -> Option<V>
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> boolwhere
K: Borrow<Q>,
Q: Hash + Eq,
pub fn items<'a>(
&'a self
) -> UnordItems<(&'a K, &'a V), impl Iterator<Item = (&'a K, &'a V)>>
pub fn into_items(self) -> UnordItems<(K, V), impl Iterator<Item = (K, V)>>
pub fn extend<I: Iterator<Item = (K, V)>>(
&mut self,
items: UnordItems<(K, V), I>
)
Trait Implementations
sourceimpl<K: Eq + Hash, V, __D: Decoder> Decodable<__D> for UnordMap<K, V>where
K: Decodable<__D>,
V: Decodable<__D>,
impl<K: Eq + Hash, V, __D: Decoder> Decodable<__D> for UnordMap<K, V>where
K: Decodable<__D>,
V: Decodable<__D>,
sourceimpl<K: Eq + Hash, V, __E: Encoder> Encodable<__E> for UnordMap<K, V>where
K: Encodable<__E>,
V: Encodable<__E>,
impl<K: Eq + Hash, V, __E: Encoder> Encodable<__E> for UnordMap<K, V>where
K: Encodable<__E>,
V: Encodable<__E>,
sourceimpl<K: Hash + Eq, V> Extend<(K, V)> for UnordMap<K, V>
impl<K: Hash + Eq, V> Extend<(K, V)> for UnordMap<K, V>
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<HCX, K: Hash + Eq + HashStable<HCX>, V: HashStable<HCX>> HashStable<HCX> for UnordMap<K, V>
impl<HCX, K: Hash + Eq + HashStable<HCX>, V: HashStable<HCX>> HashStable<HCX> for UnordMap<K, V>
fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher)
sourceimpl<K, V> !IntoIterator for UnordMap<K, V>
impl<K, V> !IntoIterator for UnordMap<K, V>
sourceimpl<K: PartialEq + Eq + Hash, V: PartialEq> PartialEq<UnordMap<K, V>> for UnordMap<K, V>
impl<K: PartialEq + Eq + Hash, V: PartialEq> PartialEq<UnordMap<K, V>> for UnordMap<K, V>
impl<K: Eq + Eq + Hash, V: Eq> Eq for UnordMap<K, V>
impl<K: Eq + Hash, V> StructuralEq for UnordMap<K, V>
impl<K: Eq + Hash, V> StructuralPartialEq for UnordMap<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for UnordMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for UnordMap<K, V>where
K: Send,
V: Send,
impl<K, V> Sync for UnordMap<K, V>where
K: Sync,
V: Sync,
impl<K, V> Unpin for UnordMap<K, V>where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for UnordMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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 Twhere
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