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>
impl<V> UnordSet<V>
pub fn new() -> UnordSet<V>
pub fn with_capacity(capacity: usize) -> UnordSet<V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn insert(&mut self, v: V) -> bool
pub fn contains<Q>(&self, v: &Q) -> bool
pub fn remove<Q>(&mut self, k: &Q) -> bool
pub fn items(&self) -> UnordItems<&V, impl Iterator<Item = &V>>
pub fn into_items(self) -> UnordItems<V, impl Iterator<Item = V>>
Sourcepub fn to_sorted<HCX>(&self, hcx: &HCX, cache_sort_key: bool) -> Vec<&V>where
V: ToStableHashKey<HCX>,
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).
Sourcepub fn to_sorted_stable_ord(&self) -> Vec<&V>where
V: StableCompare,
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.
Sourcepub fn into_sorted_stable_ord(self) -> Vec<V>where
V: StableCompare,
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.
Sourcepub fn into_sorted<HCX>(self, hcx: &HCX, cache_sort_key: bool) -> Vec<V>where
V: ToStableHashKey<HCX>,
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).
pub fn clear(&mut self)
Trait Implementations
Source§impl<V> Extend<V> for UnordSet<V>
impl<V> Extend<V> for UnordSet<V>
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = V>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = V>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)