Struct rustc_data_structures::unord::UnordSet
source · Expand description
This is a set 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 set-like collections the keys of which don’t have a semantic ordering.
See MCP 533 for more information.
Fields§
§inner: FxHashSet<V>
Implementations§
source§impl<V: Eq + Hash> UnordSet<V>
impl<V: Eq + Hash> UnordSet<V>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn insert(&mut self, v: V) -> bool
pub fn contains<Q>(&self, v: &Q) -> boolwhere
V: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn items<'a>(&'a self) -> UnordItems<&'a V, impl Iterator<Item = &'a V>>
pub fn into_items(self) -> UnordItems<V, impl Iterator<Item = V>>
pub fn extend<I: Iterator<Item = V>>(&mut self, items: UnordItems<V, I>)
Trait Implementations§
source§impl<V: Hash + Eq> Extend<V> for UnordSet<V>
impl<V: Hash + Eq> Extend<V> for UnordSet<V>
source§fn extend<T: IntoIterator<Item = V>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = V>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn 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.
source§fn 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
source§impl<HCX, V: Hash + Eq + HashStable<HCX>> HashStable<HCX> for UnordSet<V>
impl<HCX, V: Hash + Eq + HashStable<HCX>> HashStable<HCX> for UnordSet<V>
fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher)
source§impl<V> !IntoIterator for UnordSet<V>
impl<V> !IntoIterator for UnordSet<V>
source§impl<V: PartialEq + Eq + Hash> PartialEq<UnordSet<V>> for UnordSet<V>
impl<V: PartialEq + Eq + Hash> PartialEq<UnordSet<V>> for UnordSet<V>
impl<V: Eq + Eq + Hash> Eq for UnordSet<V>
impl<V: Eq + Hash> StructuralEq for UnordSet<V>
impl<V: Eq + Hash> StructuralPartialEq for UnordSet<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for UnordSet<V>where
V: RefUnwindSafe,
impl<V> Send for UnordSet<V>where
V: Send,
impl<V> Sync for UnordSet<V>where
V: Sync,
impl<V> Unpin for UnordSet<V>where
V: Unpin,
impl<V> UnwindSafe for UnordSet<V>where
V: UnwindSafe,
Blanket Implementations§
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