Type Alias DocLinkResMap

Source
pub type DocLinkResMap = UnordMap<(Symbol, Namespace), Option<Res<NodeId>>>;

Aliased Type§

struct DocLinkResMap { /* private fields */ }

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

Implementations

Source§

impl<K, V> UnordMap<K, V>
where K: Eq + Hash,

Source

pub fn with_capacity(capacity: usize) -> UnordMap<K, V>

Source

pub fn len(&self) -> usize

Source

pub fn insert(&mut self, k: K, v: V) -> Option<V>

Source

pub fn try_insert( &mut self, k: K, v: V, ) -> Result<&mut V, OccupiedError<'_, K, V>>

Source

pub fn contains_key<Q>(&self, k: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn is_empty(&self) -> bool

Source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V>

Source

pub fn get<Q>(&self, k: &Q) -> Option<&V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn items(&self) -> UnordItems<(&K, &V), impl Iterator<Item = (&K, &V)>>

Source

pub fn into_items(self) -> UnordItems<(K, V), impl Iterator<Item = (K, V)>>

Source

pub fn keys(&self) -> UnordItems<&K, impl Iterator<Item = &K>>

Source

pub fn to_sorted<HCX>(&self, hcx: &HCX, cache_sort_key: bool) -> Vec<(&K, &V)>
where K: ToStableHashKey<HCX>,

Returns the entries of this map in stable sort order (as defined by ToStableHashKey).

The cache_sort_key parameter controls if slice::sort_by_cached_key or slice::sort_unstable_by_key will be used for sorting the vec. Use cache_sort_key when the ToStableHashKey::to_stable_hash_key implementation for K is expensive (e.g. a DefId -> DefPathHash lookup).

Source

pub fn to_sorted_stable_ord(&self) -> Vec<(&K, &V)>
where K: StableCompare,

Returns the entries of this map in stable sort order (as defined by StableCompare). This method can be much more efficient than into_sorted because it does not need to transform keys to their ToStableHashKey equivalent.

Source

pub fn into_sorted<HCX>(self, hcx: &HCX, cache_sort_key: bool) -> Vec<(K, V)>
where K: ToStableHashKey<HCX>,

Returns the entries of this map in stable sort order (as defined by ToStableHashKey).

The cache_sort_key parameter controls if slice::sort_by_cached_key or slice::sort_unstable_by_key will be used for sorting the vec. Use cache_sort_key when the ToStableHashKey::to_stable_hash_key implementation for K is expensive (e.g. a DefId -> DefPathHash lookup).

Source

pub fn into_sorted_stable_ord(self) -> Vec<(K, V)>
where K: StableCompare,

Returns the entries of this map in stable sort order (as defined by StableCompare). This method can be much more efficient than into_sorted because it does not need to transform keys to their ToStableHashKey equivalent.

Source

pub fn values_sorted<HCX>( &self, hcx: &HCX, cache_sort_key: bool, ) -> impl Iterator<Item = &V>
where K: ToStableHashKey<HCX>,

Returns the values of this map in stable sort order (as defined by K’s ToStableHashKey implementation).

The cache_sort_key parameter controls if slice::sort_by_cached_key or slice::sort_unstable_by_key will be used for sorting the vec. Use cache_sort_key when the ToStableHashKey::to_stable_hash_key implementation for K is expensive (e.g. a DefId -> DefPathHash lookup).

Source

pub fn clear(&mut self)

Trait Implementations

Source§

impl<K, V> Clone for UnordMap<K, V>
where K: Clone + Eq + Hash, V: Clone,

Source§

fn clone(&self) -> UnordMap<K, V>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K, V> Debug for UnordMap<K, V>
where K: Debug + Eq + Hash, V: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<K, V, __D> Decodable<__D> for UnordMap<K, V>
where K: Eq + Hash + Decodable<__D>, __D: Decoder, V: Decodable<__D>,

Source§

fn decode(__decoder: &mut __D) -> UnordMap<K, V>

Source§

impl<K, V> Default for UnordMap<K, V>
where K: Eq + Hash,

Source§

fn default() -> UnordMap<K, V>

Returns the “default value” for a type. Read more
Source§

impl<K, V, __E> Encodable<__E> for UnordMap<K, V>
where K: Eq + Hash + Encodable<__E>, __E: Encoder, V: Encodable<__E>,

Source§

fn encode(&self, __encoder: &mut __E)

Source§

impl<K, V> Extend<(K, V)> for UnordMap<K, V>
where K: Hash + Eq,

Source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

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
Source§

impl<K, V, I> From<UnordItems<(K, V), I>> for UnordMap<K, V>
where K: Hash + Eq, I: Iterator<Item = (K, V)>,

Source§

fn from(items: UnordItems<(K, V), I>) -> UnordMap<K, V>

Converts to this type from the input type.
Source§

impl<K, V> FromIterator<(K, V)> for UnordMap<K, V>
where K: Hash + Eq,

Source§

fn from_iter<T>(iter: T) -> UnordMap<K, V>
where T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
Source§

impl<HCX, K, V> HashStable<HCX> for UnordMap<K, V>
where K: Hash + Eq + HashStable<HCX>, V: HashStable<HCX>,

Source§

fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher<SipHasher128>)

Source§

impl<K, Q, V> Index<&Q> for UnordMap<K, V>
where K: Eq + Hash + Borrow<Q>, Q: Eq + Hash + ?Sized,

Source§

type Output = V

The returned type after indexing.
Source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
Source§

impl<K, V> PartialEq for UnordMap<K, V>
where K: PartialEq + Eq + Hash, V: PartialEq,

Source§

fn eq(&self, other: &UnordMap<K, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K, V> Eq for UnordMap<K, V>
where K: Eq + Hash, V: Eq,

Source§

impl<K, V> !IntoIterator for UnordMap<K, V>

Source§

impl<K, V> StructuralPartialEq for UnordMap<K, V>
where K: Eq + Hash,