Flatten

Struct Flatten 

Source
pub struct Flatten<I> { /* private fields */ }

Trait Implementations§

Source§

impl<I: PopulatedIterator> IntoIterator for Flatten<I>

Source§

type Item = <<I as IntoIterator>::Item as IntoIterator>::Item

The type of the elements being iterated over.
Source§

type IntoIter = Flatten<<I as IntoIterator>::IntoIter>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<I: PopulatedIterator> PopulatedIterator for Flatten<I>

Source§

fn next(self) -> (Self::Item, Self::IntoIter)

Advances the iterator and returns the first value and a new iterator to the remaining values.
Source§

fn collect<C: FromPopulatedIterator<Self::Item>>(self) -> C
where Self: Sized,

Collects the iterator into a collection. Supports constructing collections that require a populated iterator.
Source§

fn map<B, F: FnMut(Self::Item) -> B>(self, f: F) -> Map<Self, F>
where Self: Sized,

Takes a closure and creates an iterator which calls that closure on each element. Preserves the populated property.
Source§

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Creates an iterator giving the current element count along with the element. Preserves the populated property.
Source§

fn zip<J>(self, other: J) -> Zip<Self, J>
where Self: Sized,

Zips this iterator with another iterator to yield a new iterator of pairs. Preserves the populated property.
Source§

fn flatten(self) -> Flatten<Self>
where Self: Sized, Self::Item: IntoPopulatedIterator,

Flattens a populated iterator of populated iteratorables into a single iterator. Preserves the populated property.
Source§

fn take(self, n: NonZeroUsize) -> Take<Self>
where Self: Sized,

Creates an iterator taking at most n elements from this iterator, where n is non-zero. Preserves the populated property.
Source§

fn flat_map<B: IntoPopulatedIterator, F: FnMut(Self::Item) -> B>( self, f: F, ) -> Flatten<Map<Self, F>>
where Self: Sized,

Creates an iterator that works like map, but flattens nested populated structure. Preserves the populated property.
Source§

fn max(self) -> Self::Item
where Self::Item: Ord, Self: Sized,

Returns the maximum element of the iterator. Note that unlike the standard library, this method directly returns the maximum element instead of an Option. This is because this method is only available on populated iterators.
Source§

fn min(self) -> Self::Item
where Self::Item: Ord, Self: Sized,

Returns the minimum element of the iterator.
Source§

fn chain<I: IntoIterator<Item = Self::Item>>( self, other: I, ) -> Chain<Self, I::IntoIter>
where Self: Sized,

Takes self populator and another iteratorable and creates a new iterator over both in sequence. Preserves the populated property.
Source§

fn reduce( self, f: impl FnMut(Self::Item, Self::Item) -> Self::Item, ) -> Self::Item
where Self: Sized,

Reduces the iterator to a single value using a closure. Note that unlike the standard library, this method directly returns the reduced value instead of an Option. This is because this method is only available on populated iterators.
Source§

fn max_by_key<K: Ord>(self, f: impl FnMut(&Self::Item) -> K) -> Self::Item
where Self: Sized,

Returns the element that gives the maximum value from the specified function. Note that unlike the standard library, this method directly returns the maximum element instead of an Option. This is because this method is only available on populated iterators.
Source§

fn max_by( self, compare: impl FnMut(&Self::Item, &Self::Item) -> Ordering, ) -> Self::Item
where Self: Sized,

Returns the element that gives the maximum value with respect to the specified comparison function. Note that unlike the standard library, this method directly returns the maximum element instead of an Option. This is because this method is only available on populated iterators.
Source§

fn min_by_key<K: Ord>(self, f: impl FnMut(&Self::Item) -> K) -> Self::Item
where Self: Sized,

Returns the element that gives the minimum value from the specified function. Note that unlike the standard library, this method directly returns the minimum element instead of an Option. This is because this method is only available on populated iterators.
Source§

fn min_by( self, compare: impl FnMut(&Self::Item, &Self::Item) -> Ordering, ) -> Self::Item
where Self: Sized,

Returns the element that gives the minimum value with respect to the specified comparison function. Note that unlike the standard library, this method directly returns the minimum element instead of an Option. This is because this method is only available on populated iterators.
Source§

fn eq<I: IntoIterator>(self, other: I) -> bool
where Self::Item: PartialEq<I::Item>, Self: Sized,

Source§

fn last(self) -> Self::Item
where Self: Sized,

Source§

fn rev(self) -> Rev<Self>
where Self: Sized,

Source§

fn nth(self, n: usize) -> (Option<Self::Item>, Self::IntoIter)
where Self: Sized,

Source§

fn count(self) -> NonZeroUsize
where Self: Sized,

Auto Trait Implementations§

§

impl<I> Freeze for Flatten<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Flatten<I>
where I: RefUnwindSafe,

§

impl<I> Send for Flatten<I>
where I: Send,

§

impl<I> Sync for Flatten<I>
where I: Sync,

§

impl<I> Unpin for Flatten<I>
where I: Unpin,

§

impl<I> UnwindSafe for Flatten<I>
where I: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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<I> IntoPopulatedIterator for I

Source§

type PopulatedIntoIter = I

Source§

fn into_populated_iter(self) -> <I as IntoPopulatedIterator>::PopulatedIntoIter

Converts the type into a PopulatedIterator.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.