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>

source

pub fn new() -> Self

source

pub fn len(&self) -> usize

source

pub fn push(&mut self, v: V)

source

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

source

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

Trait Implementations§

source§

impl<V: Clone> Clone for UnordBag<V>

source§

fn clone(&self) -> UnordBag<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> Debug for UnordBag<V>

source§

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

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

impl<V, __D: Decoder> Decodable<__D> for UnordBag<V>where V: Decodable<__D>,

source§

fn decode(__decoder: &mut __D) -> Self

source§

impl<V: Default> Default for UnordBag<V>

source§

fn default() -> UnordBag<V>

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

impl<V, __E: Encoder> Encodable<__E> for UnordBag<V>where V: Encodable<__E>,

source§

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

source§

impl<T> Extend<T> for UnordBag<T>

source§

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)

🔬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<T, I: Iterator<Item = T>> From<UnordItems<T, I>> for UnordBag<T>

source§

fn from(value: UnordItems<T, I>) -> Self

Converts to this type from the input type.
source§

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

source§

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

source§

impl<T> !IntoIterator for UnordBag<T>

§

type Item

The type of the elements being iterated over.
§

type IntoIter: Iterator<Item = Self::Item>

Which kind of iterator are we turning this into?
1.0.0 · source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<V: PartialEq> PartialEq<UnordBag<V>> for UnordBag<V>

source§

fn eq(&self, other: &UnordBag<V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<V: Eq> Eq for UnordBag<V>

source§

impl<V> StructuralEq for UnordBag<V>

source§

impl<V> StructuralPartialEq for UnordBag<V>

source§

impl<T> UnordCollection for UnordBag<T>

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§

source§

impl<T> Aligned for T

source§

const ALIGN: Alignment = const ALIGN: Alignment = Alignment::of::<Self>();

Alignment of Self.
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<C, T> ExtendUnord<T> for Cwhere C: Extend<T> + UnordCollection,

source§

fn extend_unord<I>(&mut self, items: UnordItems<T, I>)where I: Iterator<Item = T>,

Extend this unord collection with the given UnordItems. This method is called extend_unord instead of just extend so it does not conflict with Extend::extend. Otherwise there would be many places where the two methods would have to be explicitly disambiguated via UFCS.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T> Captures<'a> for Twhere T: ?Sized,

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