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
sourceimpl<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: ?Sized>(&self, v: &Q) -> boolwhere
V: Borrow<Q>,
Q: Hash + Eq,
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
sourceimpl<V: Hash + Eq> Extend<V> for UnordSet<V>
impl<V: Hash + Eq> Extend<V> for UnordSet<V>
sourcefn 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
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, 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)
sourceimpl<V> !IntoIterator for UnordSet<V>
impl<V> !IntoIterator for UnordSet<V>
sourceimpl<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
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