rustc_hir::def_id

Type Alias DefIdSet

Source
pub type DefIdSet = UnordSet<DefId>;

Aliased Type§

struct DefIdSet { /* 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<V> UnordSet<V>
where V: Eq + Hash,

Source

pub fn new() -> UnordSet<V>

Source

pub fn with_capacity(capacity: usize) -> UnordSet<V>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn insert(&mut self, v: V) -> bool

Source

pub fn contains<Q>(&self, v: &Q) -> bool
where V: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

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

Source

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

Source

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

Source

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

Returns the items of this set 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 V is expensive (e.g. a DefId -> DefPathHash lookup).

Source

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

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

Source

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

Returns the items of this set in stable sort order (as defined by StableCompare). This method is 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<V>
where V: ToStableHashKey<HCX>,

Returns the items of this set 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 V is expensive (e.g. a DefId -> DefPathHash lookup).

Source

pub fn clear(&mut self)

Trait Implementations

Source§

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

Source§

fn clone(&self) -> UnordSet<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<V> Debug for UnordSet<V>
where V: Debug + Eq + Hash,

Source§

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

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

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

Source§

fn decode(__decoder: &mut __D) -> UnordSet<V>

Source§

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

Source§

fn default() -> UnordSet<V>

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

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

Source§

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

Source§

impl<V> Extend<V> for UnordSet<V>
where V: Hash + Eq,

Source§

fn extend<T>(&mut self, iter: T)
where T: IntoIterator<Item = 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<V> From<HashSet<V, FxBuildHasher>> for UnordSet<V>
where V: Hash + Eq,

Source§

fn from(value: HashSet<V, FxBuildHasher>) -> UnordSet<V>

Converts to this type from the input type.
Source§

impl<V, I> From<UnordItems<V, I>> for UnordSet<V>
where V: Hash + Eq, I: Iterator<Item = V>,

Source§

fn from(value: UnordItems<V, I>) -> UnordSet<V>

Converts to this type from the input type.
Source§

impl<V> FromIterator<V> for UnordSet<V>
where V: Hash + Eq,

Source§

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

Creates a value from an iterator. Read more
Source§

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

Source§

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

Source§

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

Source§

fn eq(&self, other: &UnordSet<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<V> Eq for UnordSet<V>
where V: Eq + Hash,

Source§

impl<V> !IntoIterator for UnordSet<V>

Source§

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