pub struct UnordItems<T, I: Iterator<Item = T>>(I);
Expand description

UnordItems is the order-less version of Iterator. It only contains methods that don’t (easily) expose an ordering of the underlying items.

Most methods take an Fn where the Iterator-version takes an FnMut. This is to reduce the risk of accidentally leaking the internal order via the closure environment. Otherwise one could easily do something like

let mut ordered = vec![];
unordered_items.all(|x| ordered.push(x));

It’s still possible to do the same thing with an Fn by using interior mutability, but the chance of doing it accidentally is reduced.

Tuple Fields§

§0: I

Implementations§

Trait Implementations§

§

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?
Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.