Struct rustc_data_structures::unord::UnordBag
source · pub struct UnordBag<V> {
inner: Vec<V>,
}
Expand description
This is a 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 collections the
keys of which don’t have a semantic ordering and don’t implement
Hash
or Eq
.
See MCP 533 for more information.
Fields§
§inner: Vec<V>
Implementations§
source§impl<V> UnordBag<V>
impl<V> UnordBag<V>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn push(&mut self, v: V)
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<T> Extend<T> for UnordBag<T>
impl<T> Extend<T> for UnordBag<T>
source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
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 UnordBag<V>
impl<HCX, V: Hash + Eq + HashStable<HCX>> HashStable<HCX> for UnordBag<V>
fn hash_stable(&self, hcx: &mut HCX, hasher: &mut StableHasher)
source§impl<T> !IntoIterator for UnordBag<T>
impl<T> !IntoIterator for UnordBag<T>
source§impl<V: PartialEq> PartialEq<UnordBag<V>> for UnordBag<V>
impl<V: PartialEq> PartialEq<UnordBag<V>> for UnordBag<V>
impl<V: Eq> Eq for UnordBag<V>
impl<V> StructuralEq for UnordBag<V>
impl<V> StructuralPartialEq for UnordBag<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for UnordBag<V>where
V: RefUnwindSafe,
impl<V> Send for UnordBag<V>where
V: Send,
impl<V> Sync for UnordBag<V>where
V: Sync,
impl<V> Unpin for UnordBag<V>where
V: Unpin,
impl<V> UnwindSafe for UnordBag<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: 24 bytes