Skip to main content

Map

Struct Map 

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

A lender that maps the values of the underlying lender with a closure.

This struct is created by the map() method on Lender.

Implementations§

Source§

impl<L, F> Map<L, F>

Source

pub fn into_inner(self) -> L

Returns the inner lender.

Source

pub fn into_parts(self) -> (L, Covar<F>)

Returns the inner lender and the mapping function.

Trait Implementations§

Source§

impl<L: Clone, F: Clone> Clone for Map<L, F>

Source§

fn clone(&self) -> Map<L, F>

Returns a duplicate 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<L: Debug, F> Debug for Map<L, F>

Source§

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

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

impl<L: DoubleEndedFallibleLender, F> DoubleEndedFallibleLender for Map<L, F>
where F: for<'all> FnMutHKARes<'all, FallibleLend<'all, L>, L::Error>,

Source§

fn next_back(&mut self) -> Result<Option<FallibleLend<'_, Self>>, Self::Error>

Removes and returns a lend from the end of the lender, or an error. Read more
Source§

fn try_rfold<B, Fold, R>( &mut self, init: B, fold: Fold, ) -> Result<R, Self::Error>
where Self: Sized, Fold: FnMut(B, FallibleLend<'_, Self>) -> Result<R, Self::Error>, R: Try<Output = B>,

The reverse version of FallibleLender::try_fold: it takes elements starting from the back of the lender. Read more
Source§

fn rfold<B, Fold>(self, init: B, fold: Fold) -> Result<B, Self::Error>
where Self: Sized, Fold: FnMut(B, FallibleLend<'_, Self>) -> Result<B, Self::Error>,

The reverse version of FallibleLender::fold: it takes elements starting from the back of the lender. Read more
Source§

fn advance_back_by( &mut self, n: usize, ) -> Result<Result<(), NonZeroUsize>, Self::Error>

Advances the lender from the back by n elements. Read more
Source§

fn nth_back( &mut self, n: usize, ) -> Result<Option<FallibleLend<'_, Self>>, Self::Error>

Returns the nth element from the end of the lender. Read more
Source§

fn rfind<P>( &mut self, predicate: P, ) -> Result<Option<FallibleLend<'_, Self>>, Self::Error>
where Self: Sized, P: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

The reverse version of FallibleLender::find: it searches for an element from the back that satisfies the predicate. Read more
Source§

impl<L: DoubleEndedLender, F> DoubleEndedLender for Map<L, F>
where F: for<'all> FnMutHKA<'all, Lend<'all, L>>,

Source§

fn next_back(&mut self) -> Option<Lend<'_, Self>>

Removes and returns a lend from the end of the lender. Read more
Source§

fn try_rfold<B, Fold, R>(&mut self, init: B, fold: Fold) -> R
where Self: Sized, Fold: FnMut(B, Lend<'_, Self>) -> R, R: Try<Output = B>,

The reverse version of Lender::try_fold: it takes elements starting from the back of the lender. Read more
Source§

fn rfold<B, Fold>(self, init: B, fold: Fold) -> B
where Self: Sized, Fold: FnMut(B, Lend<'_, Self>) -> B,

The reverse version of Lender::fold: it takes elements starting from the back of the lender. Read more
Source§

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

Advances the lender from the back by n elements. Read more
Source§

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

Returns the nth element from the end of the lender. Read more
Source§

fn rfind<P>(&mut self, predicate: P) -> Option<Lend<'_, Self>>
where Self: Sized, P: FnMut(&Lend<'_, Self>) -> bool,

The reverse version of Lender::find: it searches for an element of the lender from the back that satisfies the predicate. Read more
Source§

impl<L: ExactSizeFallibleLender, F> ExactSizeFallibleLender for Map<L, F>
where F: for<'all> FnMutHKARes<'all, FallibleLend<'all, L>, L::Error>,

Source§

fn len(&self) -> usize

Returns the exact remaining length of the lender. Read more
Source§

fn is_empty(&self) -> bool

Returns true if the lender has no more elements.
Source§

impl<L: ExactSizeLender, F> ExactSizeLender for Map<L, F>
where F: for<'all> FnMutHKA<'all, Lend<'all, L>>,

Source§

fn len(&self) -> usize

Returns the exact remaining length of the lender. Read more
Source§

fn is_empty(&self) -> bool

Returns true if the lender has no more elements.
Source§

impl<L, F> FallibleLender for Map<L, F>
where F: for<'all> FnMutHKARes<'all, FallibleLend<'all, L>, L::Error>, L: FallibleLender,

Source§

type Error = <L as FallibleLender>::Error

The error type.
Source§

fn __check_covariance<'long: 'short, 'short>( proof: CovariantProof<&'short <Self as FallibleLending<'long>>::Lend>, ) -> CovariantProof<&'short <Self as FallibleLending<'short>>::Lend>

Internal method for compile-time covariance checking. Read more
Source§

fn next(&mut self) -> Result<Option<FallibleLend<'_, Self>>, Self::Error>

Yields the next lend, if any, of the lender, or Ok(None) when iteration is finished. Read more
Source§

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

Gets the estimated minimum and maximum length of the lender. Both bounds assume that all remaining calls to next() succeed. That is, next() could return an Err in fewer calls than specified by the lower bound. Read more
Source§

fn try_fold<B, Fold, R>( &mut self, init: B, fold: Fold, ) -> Result<R, Self::Error>
where Self: Sized, Fold: FnMut(B, FallibleLend<'_, Self>) -> Result<R, Self::Error>, R: Try<Output = B>,

Source§

fn fold<B, Fold>(self, init: B, fold: Fold) -> Result<B, Self::Error>
where Self: Sized, Fold: FnMut(B, FallibleLend<'_, Self>) -> Result<B, Self::Error>,

Source§

fn next_chunk(&mut self, chunk_size: usize) -> Chunk<'_, Self>
where Self: Sized,

Takes the next chunk_size lends of the lender with temporary lender Chunk. This is equivalent to cloning the lender and calling take(chunk_size) on it. Read more
Source§

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

Counts the number of lends in the lender by consuming it until the lender yields Ok(None) or Err(_). Read more
Source§

fn last<'call>( &'call mut self, ) -> Result<Option<FallibleLend<'call, Self>>, Self::Error>
where Self: Sized,

Gets the last lend of the lender, if any, by consuming it. Read more
Source§

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

Advances the lender by n lends. Read more
Source§

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

Yields the nth lend of the lender, if any, by consuming it. If the lender does not have enough lends, returns Ok(None). Read more
Source§

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

Skips step - 1 lends between each lend of the lender. Read more
Source§

fn chain<U>( self, other: U, ) -> Chain<Self, <U as IntoFallibleLender>::FallibleLender>
where Self: Sized, U: IntoFallibleLender<Error = Self::Error> + for<'all> FallibleLending<'all, Lend = FallibleLend<'all, Self>>,

Chains the lender with another lender of the same type. Read more
Source§

fn zip<U: IntoFallibleLender>( self, other: U, ) -> Zip<Self, <U as IntoFallibleLender>::FallibleLender>
where Self: Sized,

Zips the lender with another lender of the same or different type. Read more
Source§

fn intersperse<'call>( self, separator: FallibleLend<'call, Self>, ) -> FallibleIntersperse<'call, Self>
where Self: Sized, for<'all> FallibleLend<'all, Self>: Clone,

Intersperses each lend of this lender with the given separator. Read more
Source§

fn intersperse_with<'call, G>( self, separator: G, ) -> FallibleIntersperseWith<'call, Self, G>
where Self: Sized, G: FnMut() -> Result<FallibleLend<'call, Self>, Self::Error>,

Intersperses each lend of this lender with the separator produced by the given function. Read more
Source§

fn map<F>(self, f: Covar<F>) -> Map<Self, F>
where Self: Sized, F: for<'all> FnMutHKARes<'all, FallibleLend<'all, Self>, Self::Error>,

Maps each lend of this lender using the given function. Read more
Source§

fn map_err<E, F>(self, f: F) -> MapErr<E, Self, F>
where Self: Sized, F: FnMut(Self::Error) -> E,

Maps the error of this lender using the given function. Read more
Source§

fn map_into_iter<O, F>(self, f: F) -> MapIntoIter<Self, O, F>
where Self: Sized, F: FnMut(FallibleLend<'_, Self>) -> Result<O, Self::Error>,

Maps each lend of this lender into an owned value using the given function. Read more
Source§

fn for_each<F>(self, f: F) -> Result<(), Self::Error>
where Self: Sized, F: FnMut(FallibleLend<'_, Self>) -> Result<(), Self::Error>,

Calls the given function with each lend of this lender. Read more
Source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where Self: Sized, P: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Filters this lender using the given predicate. Read more
Source§

fn filter_map<F>(self, f: Covar<F>) -> FilterMap<Self, F>
where Self: Sized, F: for<'all> FnMutHKAResOpt<'all, FallibleLend<'all, Self>, Self::Error>,

Filters and maps this lender using the given function. Read more
Source§

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

Enumerates this lender. Each lend is paired with its zero-based index. Read more
Source§

fn peekable<'call>(self) -> FalliblePeekable<'call, Self>
where Self: Sized,

Makes this lender peekable, so that it is possible to peek at the next lend without consuming it. Read more
Source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where Self: Sized, P: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Skips the first contiguous sequence of lends of this lender that satisfy the given predicate. Read more
Source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where Self: Sized, P: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Takes the first contiguous sequence of lends of this lender that satisfy the given predicate. Read more
Source§

fn map_while<P>(self, predicate: Covar<P>) -> MapWhile<Self, P>
where Self: Sized, P: for<'all> FnMutHKAResOpt<'all, FallibleLend<'all, Self>, Self::Error>,

Maps this lender using the given function while it returns Some. Read more
Source§

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Skips the first n lends of this lender. Read more
Source§

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

Takes the first n lends of this lender. Read more
Source§

fn scan<St, F>(self, initial_state: St, f: Covar<F>) -> Scan<Self, St, F>
where Self: Sized, F: for<'all> FnMutHKAResOpt<'all, (&'all mut St, FallibleLend<'all, Self>), Self::Error>,

Source§

fn flat_map<'call, F>(self, f: Covar<F>) -> FallibleFlatMap<'call, Self, F>
where Self: Sized, F: for<'all> FnMutHKARes<'all, FallibleLend<'all, Self>, Self::Error>, for<'all> <F as FnMutHKARes<'all, FallibleLend<'all, Self>, Self::Error>>::B: IntoFallibleLender<Error = Self::Error>,

Source§

fn flatten<'call>(self) -> FallibleFlatten<'call, Self>
where Self: Sized, for<'all> FallibleLend<'all, Self>: IntoFallibleLender<Error = Self::Error>,

Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where Self: Sized, F: FnMut(&FallibleLend<'_, Self>) -> Result<(), Self::Error>,

Source§

fn mutate<F>(self, f: F) -> Mutate<Self, F>
where Self: Sized, F: FnMut(&mut FallibleLend<'_, Self>) -> Result<(), Self::Error>,

Mutates each lend with the given function. Read more
Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Source§

fn collect<B>(self) -> Result<B, (B, Self::Error)>
where Self: Sized, for<'all> B: FromLender<NonFallibleAdapter<'all, Self>>,

Transforms the fallible lender into a collection. If any invocation of next returns Err, returns the collection built from values yielded successfully, together with the error. Read more
Source§

fn try_collect<'a, B, T>(&'a mut self) -> Result<T, (T, Self::Error)>
where Self: Sized, for<'all> FallibleLend<'all, Self>: Try, for<'all> <FallibleLend<'all, Self> as Try>::Residual: Residual<B, TryType = T>, for<'b, 'c, 'd> B: FromLender<FallibleTryShuntAdapter<'b, 'c, 'd, 'a, Self>>,

Collects the lends of a fallible lender that are themselves Try types into a collection of their outputs, short-circuiting on both lender errors and Try failures. Read more
Source§

fn collect_into<E>( self, collection: &mut E, ) -> Result<&mut E, (&mut E, Self::Error)>
where Self: Sized, for<'all> E: ExtendLender<NonFallibleAdapter<'all, Self>>,

Extends an existing collection with lends from this fallible lender. Read more
Source§

fn partition<'this, E, F>(self, f: F) -> Result<(E, E), ((E, E), Self::Error)>
where Self: Sized + 'this, E: Default + ExtendLender<NonFallibleAdapter<'this, Self>>, F: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn is_partitioned<P>(self, predicate: P) -> Result<bool, Self::Error>
where Self: Sized, P: FnMut(FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn try_for_each<F, R>(&mut self, f: F) -> Result<R, Self::Error>
where F: FnMut(FallibleLend<'_, Self>) -> Result<R, Self::Error>, R: Try<Output = ()>,

Source§

fn reduce<T, F>(self, f: F) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(T, FallibleLend<'_, Self>) -> Result<T, Self::Error>,

Source§

fn try_reduce<T, F, R>( self, f: F, ) -> Result<ChangeOutputType<R, Option<T>>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(T, FallibleLend<'_, Self>) -> Result<R, Self::Error>, R: Try<Output = T>, R::Residual: Residual<Option<T>>,

Source§

fn all<F>(&mut self, f: F) -> Result<bool, Self::Error>
where F: FnMut(FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn any<F>(&mut self, f: F) -> Result<bool, Self::Error>
where F: FnMut(FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn find<P>( &mut self, predicate: P, ) -> Result<Option<FallibleLend<'_, Self>>, Self::Error>
where P: FnMut(&FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn find_map<'a, F>( &'a mut self, f: F, ) -> Result<Option<<F as FnMutHKAResOpt<'a, FallibleLend<'a, Self>, Self::Error>>::B>, Self::Error>
where Self: Sized, F: for<'all> FnMutHKAResOpt<'all, FallibleLend<'all, Self>, Self::Error>,

Source§

fn try_find<F, R>( &mut self, f: F, ) -> Result<ChangeOutputType<R, Option<FallibleLend<'_, Self>>>, Self::Error>
where Self: Sized, F: FnMut(&FallibleLend<'_, Self>) -> Result<R, Self::Error>, R: Try<Output = bool>, for<'all> R::Residual: Residual<Option<FallibleLend<'all, Self>>>,

Source§

fn position<P>(&mut self, predicate: P) -> Result<Option<usize>, Self::Error>
where Self: Sized, P: FnMut(FallibleLend<'_, Self>) -> Result<bool, Self::Error>,

Source§

fn rposition<P>(&mut self, predicate: P) -> Result<Option<usize>, Self::Error>

Source§

fn max<T: Ord>(self) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>,

Source§

fn min<T: Ord>(self) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>,

Source§

fn max_by_key<B: Ord, T, F>(self, f: F) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T) -> Result<B, Self::Error>,

Source§

fn max_by<T, F>(self, compare: F) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &FallibleLend<'_, Self>) -> Result<Ordering, Self::Error>,

Source§

fn min_by_key<B: Ord, T, F>(self, f: F) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T) -> Result<B, Self::Error>,

Source§

fn min_by<T, F>(self, compare: F) -> Result<Option<T>, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &FallibleLend<'_, Self>) -> Result<Ordering, Self::Error>,

Source§

fn rev(self) -> Rev<Self>

Source§

fn unzip<ExtA, ExtB>(self) -> Result<(ExtA, ExtB), Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: TupleLend<'all>, ExtA: Default + for<'this> ExtendLender<NonFallibleAdapter<'this, <FirstShunt<Self> as IntoFallibleLender>::FallibleLender>>, ExtB: Default + for<'this> ExtendLender<NonFallibleAdapter<'this, <SecondShunt<Self> as IntoFallibleLender>::FallibleLender>>,

Source§

fn copied<T>(self) -> Copied<Self>
where Self: Sized + for<'all> FallibleLending<'all, Lend = &'all T>, T: Copy,

Source§

fn cloned<T>(self) -> Cloned<Self>
where Self: Sized + for<'all> FallibleLending<'all, Lend = &'all T>, T: Clone,

Source§

fn owned(self) -> Owned<Self>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned,

Source§

fn cycle(self) -> Cycle<Self>
where Self: Sized + Clone,

Source§

fn sum<S>(self) -> Result<S, Self::Error>
where Self: Sized, S: SumFallibleLender<Self>,

Source§

fn product<P>(self) -> Result<P, Self::Error>
where Self: Sized, P: ProductFallibleLender<Self>,

Source§

fn cmp<L>(self, other: L) -> Result<Ordering, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, L::FallibleLender: for<'all> FallibleLending<'all, Lend = FallibleLend<'all, Self>>, for<'all> FallibleLend<'all, Self>: Ord, Self: Sized,

Source§

fn cmp_by<L, F>(self, other: L, cmp: F) -> Result<Ordering, Self::Error>
where Self: Sized, L: IntoFallibleLender<Error = Self::Error>, F: for<'all> FnMut(FallibleLend<'all, Self>, FallibleLend<'all, L::FallibleLender>) -> Result<Ordering, Self::Error>,

Source§

fn partial_cmp<L>(self, other: L) -> Result<Option<Ordering>, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialOrd<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn partial_cmp_by<L, F>( self, other: L, partial_cmp: F, ) -> Result<Option<Ordering>, Self::Error>
where Self: Sized, L: IntoFallibleLender<Error = Self::Error>, F: for<'all> FnMut(FallibleLend<'all, Self>, FallibleLend<'all, L::FallibleLender>) -> Result<Option<Ordering>, Self::Error>,

Source§

fn eq<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialEq<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn eq_by<L, F>(self, other: L, eq: F) -> Result<bool, Self::Error>
where Self: Sized, L: IntoFallibleLender<Error = Self::Error>, F: for<'all> FnMut(FallibleLend<'all, Self>, FallibleLend<'all, L::FallibleLender>) -> Result<bool, Self::Error>,

Source§

fn ne<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialEq<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn lt<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialOrd<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn le<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialOrd<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn gt<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialOrd<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn ge<L>(self, other: L) -> Result<bool, Self::Error>
where L: IntoFallibleLender<Error = Self::Error>, for<'all> FallibleLend<'all, Self>: PartialOrd<FallibleLend<'all, L::FallibleLender>>, Self: Sized,

Source§

fn is_sorted<T>(self) -> Result<bool, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, T: PartialOrd,

Source§

fn is_sorted_by<T, F>(self, compare: F) -> Result<bool, Self::Error>
where Self: Sized, for<'all> FallibleLend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &T) -> Result<Option<Ordering>, Self::Error>,

Source§

fn is_sorted_by_key<F, K>(self, f: F) -> Result<bool, Self::Error>
where Self: Sized, F: FnMut(FallibleLend<'_, Self>) -> Result<K, Self::Error>, K: PartialOrd,

Source§

fn chunky(self, chunk_size: usize) -> Chunky<Self>

A lending replacement for Iterator::array_chunks. Read more
Source§

fn iter<'this>(self) -> Iter<'this, Self>
where Self: Sized + 'this, for<'all> FallibleLend<'all, Self>: 'this,

Turns this FallibleLender into a FallibleIterator where it has already fulfilled the requirements of the FallibleIterator trait. Read more
Source§

fn lender_by_ref<'this>(self) -> FromFallibleIterRef<Iter<'this, Self>>
where Self: Sized + 'this, for<'all> FallibleLend<'all, Self>: 'this,

Turns this FallibleLender into a new FallibleLender that lends references to the items of the original lender. Read more
Source§

impl<'lend, L, F> FallibleLending<'lend> for Map<L, F>
where F: for<'all> FnMutHKARes<'all, FallibleLend<'all, L>, L::Error>, L: FallibleLender,

Source§

type Lend = <F as FnMutHKARes<'lend, <L as FallibleLending<'lend>>::Lend, <L as FallibleLender>::Error>>::B

The type being lent.
Source§

impl<L, F> Lender for Map<L, F>
where F: for<'all> FnMutHKA<'all, Lend<'all, L>>, L: Lender,

Source§

fn __check_covariance<'long: 'short, 'short>( proof: CovariantProof<<Self as Lending<'long>>::Lend>, ) -> CovariantProof<<Self as Lending<'short>>::Lend>

Internal method for compile-time covariance checking. Read more
Source§

fn next(&mut self) -> Option<Lend<'_, Self>>

Yields the next lend, if any, of the lender. Read more
Source§

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

Gets the estimated minimum and maximum length of the lender. Use .len() for the exact length if the lender implements ExactSizeLender. Read more
Source§

fn try_fold<B, Fold, R>(&mut self, init: B, fold: Fold) -> R
where Self: Sized, Fold: FnMut(B, Lend<'_, Self>) -> R, R: Try<Output = B>,

Source§

fn fold<B, Fold>(self, init: B, fold: Fold) -> B
where Self: Sized, Fold: FnMut(B, Lend<'_, Self>) -> B,

Source§

fn next_chunk(&mut self, chunk_size: usize) -> Chunk<'_, Self>
where Self: Sized,

Takes the next chunk_size lends of the lender with temporary lender Chunk. This is equivalent to cloning the lender and calling take(chunk_size) on it. Read more
Source§

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

Counts the number of lends in the lender by consuming it. Read more
Source§

fn last<'call>(&'call mut self) -> Option<Lend<'call, Self>>
where Self: Sized,

Gets the last lend of the lender, if any, by consuming it. Read more
Source§

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

Advances the lender by n lends. Read more
Source§

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

Yields the nth lend of the lender, if any, by consuming it. If the lender does not have enough lends, returns None. Read more
Source§

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

Skips step - 1 lends between each lend of the lender. Read more
Source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoLender>::Lender>
where Self: Sized, for<'all> U: IntoLender + Lending<'all, Lend = Lend<'all, Self>>,

Chains the lender with another lender of the same type. Read more
Source§

fn zip<U: IntoLender>(self, other: U) -> Zip<Self, <U as IntoLender>::Lender>
where Self: Sized,

Zips the lender with another lender of the same or different type. Read more
Source§

fn intersperse<'call>( self, separator: Lend<'call, Self>, ) -> Intersperse<'call, Self>
where Self: Sized, for<'all> Lend<'all, Self>: Clone,

Intersperses each lend of this lender with the given separator. Read more
Source§

fn intersperse_with<'call, G>( self, separator: G, ) -> IntersperseWith<'call, Self, G>
where Self: Sized, G: FnMut() -> Lend<'call, Self>,

Intersperses each lend of this lender with the separator produced by the given function. Read more
Source§

fn map<F>(self, f: Covar<F>) -> Map<Self, F>
where Self: Sized, F: for<'all> FnMutHKA<'all, Lend<'all, Self>>,

Maps each lend of this lender using the given function. Read more
Source§

fn map_into_iter<O, F: FnMut(Lend<'_, Self>) -> O>( self, f: F, ) -> MapIntoIter<Self, O, F>
where Self: Sized,

Maps each lend of this lender into an owned value using the given function. Read more
Source§

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

Calls the given function with each lend of this lender. Read more
Source§

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

Filters this lender using the given predicate. Read more
Source§

fn filter_map<F>(self, f: Covar<F>) -> FilterMap<Self, F>
where Self: Sized, F: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,

Filters and maps this lender using the given function. Read more
Source§

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

Enumerates this lender. Each lend is paired with its zero-based index. Read more
Source§

fn peekable<'call>(self) -> Peekable<'call, Self>
where Self: Sized,

Makes this lender peekable, so that it is possible to peek at the next lend without consuming it. Read more
Source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where Self: Sized, P: FnMut(&Lend<'_, Self>) -> bool,

Skips the first contiguous sequence of lends of this lender that satisfy the given predicate. Read more
Source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where Self: Sized, P: FnMut(&Lend<'_, Self>) -> bool,

Takes the first contiguous sequence of lends of this lender that satisfy the given predicate. Read more
Source§

fn map_while<P>(self, predicate: Covar<P>) -> MapWhile<Self, P>
where Self: Sized, P: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,

Maps this lender using the given function while it returns Some. Read more
Source§

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Skips the first n lends of this lender. Read more
Source§

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

Takes the first n lends of this lender. Read more
Source§

fn scan<St, F>(self, initial_state: St, f: Covar<F>) -> Scan<Self, St, F>
where Self: Sized, F: for<'all> FnMutHKAOpt<'all, (&'all mut St, Lend<'all, Self>)>,

Source§

fn flat_map<'call, F>(self, f: Covar<F>) -> FlatMap<'call, Self, F>
where Self: Sized, F: for<'all> FnMutHKA<'all, Lend<'all, Self>>, for<'all> <F as FnMutHKA<'all, Lend<'all, Self>>>::B: IntoLender,

Source§

fn flatten<'call>(self) -> Flatten<'call, Self>
where Self: Sized, for<'all> Lend<'all, Self>: IntoLender,

Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where Self: Sized, F: FnMut(&Lend<'_, Self>),

Source§

fn mutate<F>(self, f: F) -> Mutate<Self, F>
where Self: Sized, F: FnMut(&mut Lend<'_, Self>),

Mutates each lend with the given function. Read more
Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Source§

fn collect<B>(self) -> B
where Self: Sized, B: FromLender<Self>,

Source§

fn try_collect<'a, B>(&'a mut self) -> ChangeOutputType<Lend<'a, Self>, B>
where Self: Sized, for<'all> Lend<'all, Self>: Try, for<'all> <Lend<'all, Self> as Try>::Residual: Residual<B>, for<'all> B: FromLender<TryShunt<'all, &'a mut Self>>,

Source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where Self: Sized, E: ExtendLender<Self>,

Source§

fn partition<E, F>(self, f: F) -> (E, E)
where Self: Sized, E: Default + ExtendLender<Self>, F: FnMut(&Lend<'_, Self>) -> bool,

Source§

fn is_partitioned<P>(self, predicate: P) -> bool
where Self: Sized, P: FnMut(Lend<'_, Self>) -> bool,

Source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where F: FnMut(Lend<'_, Self>) -> R, R: Try<Output = ()>,

Source§

fn reduce<T, F>(self, f: F) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(T, Lend<'_, Self>) -> T,

Source§

fn try_reduce<T, F, R>(self, f: F) -> ChangeOutputType<R, Option<T>>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(T, Lend<'_, Self>) -> R, R: Try<Output = T>, R::Residual: Residual<Option<T>>,

Source§

fn all<F>(&mut self, f: F) -> bool
where F: FnMut(Lend<'_, Self>) -> bool,

Source§

fn any<F>(&mut self, f: F) -> bool
where F: FnMut(Lend<'_, Self>) -> bool,

Source§

fn find<P>(&mut self, predicate: P) -> Option<Lend<'_, Self>>
where Self: Sized, P: FnMut(&Lend<'_, Self>) -> bool,

Source§

fn find_map<'a, F>( &'a mut self, f: F, ) -> Option<<F as FnMutHKAOpt<'a, Lend<'a, Self>>>::B>
where Self: Sized, F: for<'all> FnMutHKAOpt<'all, Lend<'all, Self>>,

Source§

fn try_find<F, R>( &mut self, f: F, ) -> ChangeOutputType<R, Option<Lend<'_, Self>>>
where Self: Sized, F: FnMut(&Lend<'_, Self>) -> R, R: Try<Output = bool>, for<'all> R::Residual: Residual<Option<Lend<'all, Self>>>,

Source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where Self: Sized, P: FnMut(Lend<'_, Self>) -> bool,

Source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where P: FnMut(Lend<'_, Self>) -> bool, Self: Sized + ExactSizeLender + DoubleEndedLender,

Source§

fn max<T: Ord>(self) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>,

Source§

fn min<T: Ord>(self) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>,

Source§

fn max_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T) -> B,

Source§

fn max_by<T, F>(self, compare: F) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &Lend<'_, Self>) -> Ordering,

Source§

fn min_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T) -> B,

Source§

fn min_by<T, F>(self, compare: F) -> Option<T>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &Lend<'_, Self>) -> Ordering,

Source§

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

Source§

fn unzip<ExtA, ExtB>(self) -> (ExtA, ExtB)
where Self: Sized, for<'all> Lend<'all, Self>: TupleLend<'all>, ExtA: Default + ExtendLender<FirstShunt<Self>>, ExtB: Default + ExtendLender<SecondShunt<Self>>,

Source§

fn copied<T>(self) -> Copied<Self>
where Self: Sized + for<'all> Lending<'all, Lend = &'all T>, T: Copy,

Source§

fn cloned<T>(self) -> Cloned<Self>
where Self: Sized + for<'all> Lending<'all, Lend = &'all T>, T: Clone,

Source§

fn owned(self) -> Owned<Self>
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned,

Turns this Lender into an Iterator. Read more
Source§

fn cycle(self) -> Cycle<Self>
where Self: Sized + Clone,

Source§

fn sum<S>(self) -> S
where Self: Sized, S: SumLender<Self>,

Source§

fn product<P>(self) -> P
where Self: Sized, P: ProductLender<Self>,

Source§

fn cmp<L>(self, other: L) -> Ordering
where L: IntoLender, L::Lender: for<'all> Lending<'all, Lend = Lend<'all, Self>>, for<'all> Lend<'all, Self>: Ord, Self: Sized,

Source§

fn cmp_by<L, F>(self, other: L, cmp: F) -> Ordering
where Self: Sized, L: IntoLender, F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> Ordering,

Source§

fn partial_cmp<L>(self, other: L) -> Option<Ordering>
where L: IntoLender, for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>, Self: Sized,

Source§

fn partial_cmp_by<L, F>(self, other: L, partial_cmp: F) -> Option<Ordering>
where Self: Sized, L: IntoLender, F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> Option<Ordering>,

Source§

fn eq<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialEq<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::eq. Read more
Source§

fn eq_by<L, F>(self, other: L, eq: F) -> bool
where Self: Sized, L: IntoLender, F: for<'all> FnMut(Lend<'all, Self>, Lend<'all, L::Lender>) -> bool,

Source§

fn ne<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialEq<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::ne. Read more
Source§

fn lt<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::lt. Read more
Source§

fn le<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::le. Read more
Source§

fn gt<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::gt. Read more
Source§

fn ge<L>(self, other: L) -> bool
where L: IntoLender, for<'all> Lend<'all, Self>: PartialOrd<Lend<'all, L::Lender>>, Self: Sized,

The Lender version of Iterator::ge. Read more
Source§

fn is_sorted<T>(self) -> bool
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, T: PartialOrd,

Source§

fn is_sorted_by<T, F>(self, compare: F) -> bool
where Self: Sized, for<'all> Lend<'all, Self>: ToOwned<Owned = T>, F: FnMut(&T, &T) -> Option<Ordering>,

Source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where Self: Sized, F: FnMut(Lend<'_, Self>) -> K, K: PartialOrd,

Source§

fn iter<'this>(self) -> Iter<'this, Self>
where Self: Sized + 'this, for<'all> Lend<'all, Self>: 'this,

Turns this Lender into an Iterator where it has already fulfilled the requirements of the Iterator trait. Read more
Source§

fn lender_by_ref<'this>(self) -> FromIterRef<Iter<'this, Self>>
where Self: Sized + 'this, for<'all> Lend<'all, Self>: 'this,

Turns this Lender into a new Lender that lends references to the items of the original lender. Read more
Source§

fn chunky(self, chunk_size: usize) -> Chunky<Self>
where Self: Sized + ExactSizeLender,

A lending replacement for Iterator::array_chunks. Read more
Source§

fn convert<E>(self) -> Convert<E, Self>
where Self: Sized,

Converts a Lender whose lend type is Result<T, E> into a FallibleLender with error type E and lend type T. Read more
Source§

fn into_fallible(self) -> IntoFallible<Self>
where Self: Sized,

Converts a Lender into a FallibleLender by wrapping into Result<Lend<'_, Self>, Infallible> where Infallible is an error that can never actually happen. Read more
Source§

impl<'lend, L, F> Lending<'lend> for Map<L, F>
where F: for<'all> FnMutHKA<'all, Lend<'all, L>>, L: Lender,

Source§

type Lend = <F as FnMutHKA<'lend, <L as Lending<'lend>>::Lend>>::B

The type being lent.
Source§

impl<L: FusedFallibleLender, F> FusedFallibleLender for Map<L, F>
where F: for<'all> FnMutHKARes<'all, FallibleLend<'all, L>, L::Error>,

Source§

impl<L: FusedLender, F> FusedLender for Map<L, F>
where F: for<'all> FnMutHKA<'all, Lend<'all, L>>,

Auto Trait Implementations§

§

impl<L, F> Freeze for Map<L, F>
where L: Freeze, F: Freeze,

§

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

§

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

§

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

§

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

§

impl<L, F> UnsafeUnpin for Map<L, F>
where L: UnsafeUnpin, F: UnsafeUnpin,

§

impl<L, F> UnwindSafe for Map<L, F>
where L: UnwindSafe, F: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<L> IntoFallibleLender for L
where L: FallibleLender,

Source§

type Error = <L as FallibleLender>::Error

The error type of the resulting fallible lender.
Source§

type FallibleLender = L

The fallible lender type that this type converts into.
Source§

fn into_fallible_lender(self) -> L

Converts this type into a FallibleLender.
Source§

impl<L> IntoLender for L
where L: Lender,

Source§

type Lender = L

The lender type that this type converts into.
Source§

fn into_lender(self) -> L

Converts this type into a Lender.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 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.