pub struct Map<I, F> { /* private fields */ }
Expand description

A lending iterator that maps the elements of iter with f.

This struct is created by the map method on LendingIterator. See its documentation for more.

Trait Implementations§

source§

impl<I, F, O> IntoIterator for Map<I, F>
where I: LendingIterator, F: FnMut(I::Item<'_>) -> O,

§

type Item = O

The type of the elements being iterated over.
§

type IntoIter = IntoIter<I, F>

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, F> LendingIterator for Map<I, F>
where I: LendingIterator, F: for<'a> SingleArgFnMut<I::Item<'a>>,

§

type Item<'a> = <F as SingleArgFnOnce<<I as LendingIterator>::Item<'a>>>::Output where Self: 'a

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item<'_>>

Advances the lending iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

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

Returns the number of items in the lending iterator. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

Advances the lending iterator by n elements. Read more
source§

fn nth(&mut self, n: usize) -> Option<Self::Item<'_>>

Returns the nth element of the lending iterator. Read more
source§

fn step_by(self, step: usize) -> StepBy<Self>
where Self: Sized,

Creates a lending iterator starting at the same point, but stepping by the given amount at each iteration. Read more
source§

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

Creates a lending iterator that lends the first n elements, or fewer if the underlying iterator ends sooner. Read more
source§

fn chain<I>(self, other: I) -> Chain<Self, I>
where Self: Sized, for<'a> I: LendingIterator<Item<'a> = Self::Item<'a>> + 'a,

Takes two lending iterators and creates a new lending iterator over both in sequence. Read more
source§

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

‘Zips up’ two lending iterators into a single lending iterator of pairs.
source§

fn map<F>(self, f: F) -> Map<Self, F>
where Self: Sized, F: for<'a> SingleArgFnMut<Self::Item<'a>>,

Takes a closure and creates a lending iterator which calls that closure on each element. Read more
source§

fn for_each<F>(self, f: F)
where Self: Sized, F: FnMut(Self::Item<'_>),

Calls a closure on each element of the lending iterator. Read more
source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where Self: Sized, P: for<'a> FnMut(&Self::Item<'a>) -> bool,

Creates a lending iterator which uses a closure to determine if an element should be yielded. Read more
source§

fn filter_map<F>(self, f: F) -> FilterMap<Self, F>
where Self: Sized, F: for<'a> SingleArgFnMut<Self::Item<'a>>, for<'a> <F as SingleArgFnOnce<Self::Item<'a>>>::Output: OptionTrait,

Creates a lending iterator that both filters and maps. Read more
source§

fn fold<B, F>(self, init: B, f: F) -> B
where Self: Sized, F: FnMut(B, Self::Item<'_>) -> B,

Folds every element into an accumulator by applying an operation, returning the final result. Read more

Auto Trait Implementations§

§

impl<I, F> RefUnwindSafe for Map<I, F>

§

impl<I, F> Send for Map<I, F>
where F: Send, I: Send,

§

impl<I, F> Sync for Map<I, F>
where F: Sync, I: Sync,

§

impl<I, F> Unpin for Map<I, F>
where F: Unpin, I: Unpin,

§

impl<I, F> UnwindSafe for Map<I, F>
where F: UnwindSafe, 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> ToLendingIterator for I
where I: IntoIterator,

source§

fn windows(self, size: usize) -> Windows<Self::IntoIter>
where Self: Sized,

Turns this iterator into a lending iterator over windows of elements (&[Item]). Read more
source§

fn windows_mut(self, size: usize) -> WindowsMut<Self::IntoIter>
where Self: Sized,

Turns this iterator into a lending iterator over mutable windows of elements (&mut [Item]). Read more
source§

fn into_lending(self) -> IntoLending<Self::IntoIter>
where Self: Sized,

Turns this iterator into a lending iterator trivially.
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.