pub struct IntersperseWith<'this, L, G>where
L: Lender,{ /* private fields */ }Expand description
A lender that inserts an element computed by a closure between adjacent elements of the underlying lender.
This struct is created by the
intersperse_with()
method on Lender.
Implementations§
Source§impl<'this, L, G> IntersperseWith<'this, L, G>
impl<'this, L, G> IntersperseWith<'this, L, G>
Sourcepub fn into_inner(self) -> L
pub fn into_inner(self) -> L
Returns the inner lender.
Sourcepub fn into_parts(self) -> (L, G)
pub fn into_parts(self) -> (L, G)
Returns the inner lender and the separator function.
Trait Implementations§
Source§impl<L, G> Debug for IntersperseWith<'_, L, G>
impl<L, G> Debug for IntersperseWith<'_, L, G>
Source§impl<'this, L, G> Lender for IntersperseWith<'this, L, G>
impl<'this, L, G> Lender for IntersperseWith<'this, L, G>
Source§fn __check_covariance<'long: 'short, 'short>(
proof: CovariantProof<<Self as Lending<'long>>::Lend>,
) -> CovariantProof<<Self as Lending<'short>>::Lend>
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>>
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>)
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 moreSource§fn next_chunk(&mut self, chunk_size: usize) -> Chunk<'_, Self>where
Self: Sized,
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 moreSource§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
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,
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>
fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>
Advances the lender by
n lends. Read moreSource§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
Skips
step - 1 lends between each lend of the lender. Read moreSource§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoLender>::Lender>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoLender>::Lender>
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,
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>
fn intersperse<'call>( self, separator: Lend<'call, Self>, ) -> Intersperse<'call, Self>
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>
fn intersperse_with<'call, G>( self, separator: G, ) -> IntersperseWith<'call, Self, G>
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>
fn map<F>(self, f: Covar<F>) -> Map<Self, F>
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,
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 filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
Filters this lender using the given predicate. Read more
Source§fn filter_map<F>(self, f: Covar<F>) -> FilterMap<Self, F>
fn filter_map<F>(self, f: Covar<F>) -> FilterMap<Self, F>
Filters and maps this lender using the given function. Read more
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
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,
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>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
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>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
Takes the first contiguous sequence of lends of this lender that
satisfy the given predicate. Read more
Source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Skips the first
n lends of this lender. Read moreSource§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Takes the first
n lends of this lender. Read moreSource§fn mutate<F>(self, f: F) -> Mutate<Self, F>
fn mutate<F>(self, f: F) -> Mutate<Self, F>
Mutates each lend with the given function. Read more
Source§fn collect<B>(self) -> Bwhere
Self: Sized,
B: FromLender<Self>,
fn collect<B>(self) -> Bwhere
Self: Sized,
B: FromLender<Self>,
Source§fn try_collect<'a, B>(&'a mut self) -> ChangeOutputType<Lend<'a, Self>, B>
fn try_collect<'a, B>(&'a mut self) -> ChangeOutputType<Lend<'a, Self>, B>
Source§fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere
Self: Sized,
E: ExtendLender<Self>,
fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere
Self: Sized,
E: ExtendLender<Self>,
Source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
Source§fn try_reduce<T, F, R>(self, f: F) -> ChangeOutputType<R, Option<T>>
fn try_reduce<T, F, R>(self, f: F) -> ChangeOutputType<R, Option<T>>
Source§fn find_map<'a, F>(
&'a mut self,
f: F,
) -> Option<<F as FnMutHKAOpt<'a, Lend<'a, Self>>>::B>
fn find_map<'a, F>( &'a mut self, f: F, ) -> Option<<F as FnMutHKAOpt<'a, Lend<'a, Self>>>::B>
Source§fn max_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
fn max_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
Source§fn min_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
fn min_by_key<B: Ord, T, F>(self, f: F) -> Option<T>
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>>,
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 product<P>(self) -> Pwhere
Self: Sized,
P: ProductLender<Self>,
fn product<P>(self) -> Pwhere
Self: Sized,
P: ProductLender<Self>,
Source§fn partial_cmp<L>(self, other: L) -> Option<Ordering>
fn partial_cmp<L>(self, other: L) -> Option<Ordering>
Source§fn partial_cmp_by<L, F>(self, other: L, partial_cmp: F) -> Option<Ordering>
fn partial_cmp_by<L, F>(self, other: L, partial_cmp: F) -> Option<Ordering>
Source§fn is_sorted_by<T, F>(self, compare: F) -> bool
fn is_sorted_by<T, F>(self, compare: F) -> bool
Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
Source§fn lender_by_ref<'this>(self) -> FromIterRef<Iter<'this, Self>>
fn lender_by_ref<'this>(self) -> FromIterRef<Iter<'this, Self>>
Source§fn convert<E>(self) -> Convert<E, Self>where
Self: Sized,
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 moreSource§fn into_fallible(self) -> IntoFallible<Self>where
Self: Sized,
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 moreSource§impl<'lend, 'this, L, G> Lending<'lend> for IntersperseWith<'this, L, G>
impl<'lend, 'this, L, G> Lending<'lend> for IntersperseWith<'this, L, G>
impl<'this, L, G> FusedLender for IntersperseWith<'this, L, G>
Auto Trait Implementations§
impl<'this, L, G> Freeze for IntersperseWith<'this, L, G>
impl<'this, L, G> RefUnwindSafe for IntersperseWith<'this, L, G>
impl<'this, L, G> Send for IntersperseWith<'this, L, G>
impl<'this, L, G> Sync for IntersperseWith<'this, L, G>
impl<'this, L, G> Unpin for IntersperseWith<'this, L, G>
impl<'this, L, G> UnsafeUnpin for IntersperseWith<'this, L, G>
impl<'this, L, G> UnwindSafe for IntersperseWith<'this, L, G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more