Struct layout_2020::flow::inline::construct::WhitespaceCollapse
source · pub struct WhitespaceCollapse<InputIterator> {
char_iterator: InputIterator,
white_space_collapse: T,
remove_collapsible_white_space_at_start: bool,
following_newline: bool,
have_seen_non_white_space_characters: bool,
inside_white_space: bool,
character_pending_to_return: Option<char>,
}
Fields§
§char_iterator: InputIterator
§white_space_collapse: T
§remove_collapsible_white_space_at_start: bool
Whether or not we should collapse white space completely at the start of the string.
This is true when the last character handled in our owning super::InlineFormattingContext
was collapsible white space.
following_newline: bool
Whether or not the last character produced was newline. There is special behavior we do after each newline.
have_seen_non_white_space_characters: bool
Whether or not we have seen any non-white space characters, indicating that we are not in a collapsible white space section at the beginning of the string.
inside_white_space: bool
Whether the last character that we processed was a non-newline white space character. When collapsing white space we need to wait until the next non-white space character or the end of the string to push a single white space.
character_pending_to_return: Option<char>
When we enter a collapsible white space region, we may need to wait to produce a single white space character as soon as we encounter a non-white space character. When that happens we queue up the non-white space character for the next iterator call.
Implementations§
source§impl<InputIterator> WhitespaceCollapse<InputIterator>
impl<InputIterator> WhitespaceCollapse<InputIterator>
pub fn new( char_iterator: InputIterator, white_space_collapse: WhiteSpaceCollapse, trim_beginning_white_space: bool, ) -> Self
fn is_leading_trimmed_white_space(&self) -> bool
sourcefn need_to_produce_space_character_after_white_space(&self) -> bool
fn need_to_produce_space_character_after_white_space(&self) -> bool
Whether or not we need to produce a space character if the next character is not a newline and not white space. This happens when we are exiting a section of white space and we waited to produce a single space character for the entire section of white space (but not following or preceding a newline).
Trait Implementations§
source§impl<InputIterator> Iterator for WhitespaceCollapse<InputIterator>
impl<InputIterator> Iterator for WhitespaceCollapse<InputIterator>
source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
source§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
iter_next_chunk
)N
values. Read more1.0.0 · source§fn last(self) -> Option<Self::Item>where
Self: Sized,
fn last(self) -> Option<Self::Item>where
Self: Sized,
source§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by
)n
elements. Read more1.0.0 · source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
n
th element of the iterator. Read more1.28.0 · source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
1.0.0 · source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
source§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse
)separator
between adjacent items of the original iterator. Read more1.0.0 · source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
1.0.0 · source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
elements. Read more1.0.0 · source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n
elements, or fewer
if the underlying iterator ends sooner. Read more1.0.0 · source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows
)f
for each contiguous window of size N
over
self
and returns an iterator over the outputs of f
. Like slice::windows()
,
the windows during mapping overlap as well. Read more1.0.0 · source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into
)1.0.0 · source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
source§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned
)true
precede all those that return false
. Read more1.27.0 · source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.0.0 · source§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
1.51.0 · source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
source§fn try_reduce<F, R>(
&mut self,
f: F,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<F, R>( &mut self, f: F, ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce
)1.0.0 · source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
1.0.0 · source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
1.0.0 · source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
1.30.0 · source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
source§fn try_find<F, R>(
&mut self,
f: F,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<F, R>( &mut self, f: F, ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find
)1.0.0 · source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
1.6.0 · source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
iter_array_chunks
)N
elements of the iterator at a time. Read more1.11.0 · source§fn product<P>(self) -> P
fn product<P>(self) -> P
source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
iter_order_by
)Iterator
with those
of another with respect to the specified comparison function. Read more1.5.0 · source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
PartialOrd
elements of
this Iterator
with those of another. The comparison works like short-circuit
evaluation, returning a result without comparing the remaining elements.
As soon as an order can be determined, the evaluation stops and a result is returned. Read moresource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
)Iterator
with those
of another with respect to the specified comparison function. Read moresource§fn eq_by<I, F>(self, other: I, eq: F) -> bool
fn eq_by<I, F>(self, other: I, eq: F) -> bool
iter_order_by
)1.5.0 · source§fn lt<I>(self, other: I) -> bool
fn lt<I>(self, other: I) -> bool
Iterator
are lexicographically
less than those of another. Read more1.5.0 · source§fn le<I>(self, other: I) -> bool
fn le<I>(self, other: I) -> bool
Iterator
are lexicographically
less or equal to those of another. Read more1.5.0 · source§fn gt<I>(self, other: I) -> bool
fn gt<I>(self, other: I) -> bool
Iterator
are lexicographically
greater than those of another. Read more1.5.0 · source§fn ge<I>(self, other: I) -> bool
fn ge<I>(self, other: I) -> bool
Iterator
are lexicographically
greater than or equal to those of another. Read moresource§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
is_sorted
)source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
is_sorted
)Auto Trait Implementations§
impl<InputIterator> Freeze for WhitespaceCollapse<InputIterator>where
InputIterator: Freeze,
impl<InputIterator> RefUnwindSafe for WhitespaceCollapse<InputIterator>where
InputIterator: RefUnwindSafe,
impl<InputIterator> Send for WhitespaceCollapse<InputIterator>where
InputIterator: Send,
impl<InputIterator> Sync for WhitespaceCollapse<InputIterator>where
InputIterator: Sync,
impl<InputIterator> Unpin for WhitespaceCollapse<InputIterator>where
InputIterator: Unpin,
impl<InputIterator> UnwindSafe for WhitespaceCollapse<InputIterator>where
InputIterator: UnwindSafe,
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<I> IntoIterator for Iwhere
I: Iterator,
impl<I> IntoIterator for Iwhere
I: Iterator,
source§impl<I> IteratorRandom for Iwhere
I: Iterator,
impl<I> IteratorRandom for Iwhere
I: Iterator,
source§fn choose<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose<R>(self, rng: &mut R) -> Option<Self::Item>
source§fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item>
source§impl<T> Itertools for T
impl<T> Itertools for T
source§fn interleave<J>(
self,
other: J,
) -> Interleave<Self, <J as IntoIterator>::IntoIter>
fn interleave<J>( self, other: J, ) -> Interleave<Self, <J as IntoIterator>::IntoIter>
source§fn interleave_shortest<J>(
self,
other: J,
) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>
fn interleave_shortest<J>( self, other: J, ) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>
source§fn intersperse(
self,
element: Self::Item,
) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>
fn intersperse( self, element: Self::Item, ) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>
source§fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>
fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>
source§fn zip_longest<J>(
self,
other: J,
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
fn zip_longest<J>(
self,
other: J,
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
source§fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
source§fn batching<B, F>(self, f: F) -> Batching<Self, F>
fn batching<B, F>(self, f: F) -> Batching<Self, F>
source§fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>
fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>
source§fn chunks(self, size: usize) -> IntoChunks<Self>where
Self: Sized,
fn chunks(self, size: usize) -> IntoChunks<Self>where
Self: Sized,
source§fn tuple_windows<T>(self) -> TupleWindows<Self, T>where
Self: Sized + Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
fn tuple_windows<T>(self) -> TupleWindows<Self, T>where
Self: Sized + Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
source§fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where
Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where
Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
source§fn tuples<T>(self) -> Tuples<Self, T>
fn tuples<T>(self) -> Tuples<Self, T>
source§fn tee(self) -> (Tee<Self>, Tee<Self>)
fn tee(self) -> (Tee<Self>, Tee<Self>)
source§fn step(self, n: usize) -> Step<Self>where
Self: Sized,
fn step(self, n: usize) -> Step<Self>where
Self: Sized,
n
elements in the base iterator
for each iteration. Read moresource§fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>
fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>
source§fn map_results<F, T, U, E>(
self,
f: F,
) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
fn map_results<F, T, U, E>( self, f: F, ) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
.map_ok()
.source§fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
Result::Ok
value. Result::Err
values are
unchanged. Read moresource§fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>
fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>
Result::Ok
value with the provided closure. Result::Err
values are
unchanged. Read moresource§fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>
fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>
Result::Ok
value with the provided closure. Result::Err
values are unchanged. Read moresource§fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>
fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>
Result::Ok
value into
a series of Result::Ok
values. Result::Err
values are unchanged. Read moresource§fn merge<J>(
self,
other: J,
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>
fn merge<J>( self, other: J, ) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>
source§fn merge_by<J, F>(
self,
other: J,
is_first: F,
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>
fn merge_by<J, F>( self, other: J, is_first: F, ) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>
source§fn merge_join_by<J, F>(
self,
other: J,
cmp_fn: F,
) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>
fn merge_join_by<J, F>( self, other: J, cmp_fn: F, ) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>
source§fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>
fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>
source§fn kmerge_by<F>(
self,
first: F,
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where
Self: Sized,
Self::Item: IntoIterator,
F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
fn kmerge_by<F>(
self,
first: F,
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where
Self: Sized,
Self::Item: IntoIterator,
F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
source§fn cartesian_product<J>(
self,
other: J,
) -> Product<Self, <J as IntoIterator>::IntoIter>
fn cartesian_product<J>( self, other: J, ) -> Product<Self, <J as IntoIterator>::IntoIter>
self
and J
. Read moresource§fn multi_cartesian_product(
self,
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where
Self: Sized,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
fn multi_cartesian_product(
self,
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where
Self: Sized,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
self
. Read moresource§fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>
fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>
source§fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>
fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>
source§fn dedup_by<Cmp>(
self,
cmp: Cmp,
) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>
fn dedup_by<Cmp>( self, cmp: Cmp, ) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>
source§fn dedup_with_count(
self,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where
Self: Sized,
fn dedup_with_count(
self,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where
Self: Sized,
source§fn dedup_by_with_count<Cmp>(
self,
cmp: Cmp,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>
fn dedup_by_with_count<Cmp>( self, cmp: Cmp, ) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>
source§fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>
fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>
source§fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>
fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>
source§fn unique(self) -> Unique<Self>
fn unique(self) -> Unique<Self>
source§fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>
fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>
source§fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>
fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>
accept
returns true
. Read moresource§fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>
fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>
Clone
-able iterator
to only pick off elements while the predicate accept
returns true
. Read moresource§fn while_some<A>(self) -> WhileSome<Self>
fn while_some<A>(self) -> WhileSome<Self>
Option<A>
iterator elements
and produces A
. Stops on the first None
encountered. Read moresource§fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
source§fn combinations(self, k: usize) -> Combinations<Self>
fn combinations(self, k: usize) -> Combinations<Self>
k
-length combinations of
the elements from an iterator. Read moresource§fn combinations_with_replacement(
self,
k: usize,
) -> CombinationsWithReplacement<Self>
fn combinations_with_replacement( self, k: usize, ) -> CombinationsWithReplacement<Self>
k
-length combinations of
the elements from an iterator, with replacement. Read moresource§fn permutations(self, k: usize) -> Permutations<Self>
fn permutations(self, k: usize) -> Permutations<Self>
source§fn powerset(self) -> Powerset<Self>
fn powerset(self) -> Powerset<Self>
source§fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>
fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>
min
by filling missing elements using a closure f
. Read moresource§fn with_position(self) -> WithPosition<Self>where
Self: Sized,
fn with_position(self) -> WithPosition<Self>where
Self: Sized,
Position
to
ease special-case handling of the first or last elements. Read moresource§fn positions<P>(self, predicate: P) -> Positions<Self, P>
fn positions<P>(self, predicate: P) -> Positions<Self, P>
source§fn update<F>(self, updater: F) -> Update<Self, F>
fn update<F>(self, updater: F) -> Update<Self, F>
source§fn next_tuple<T>(&mut self) -> Option<T>
fn next_tuple<T>(&mut self) -> Option<T>
source§fn collect_tuple<T>(self) -> Option<T>
fn collect_tuple<T>(self) -> Option<T>
source§fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>
fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>
source§fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>
fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>
source§fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>
fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>
source§fn contains<Q>(&mut self, query: &Q) -> bool
fn contains<Q>(&mut self, query: &Q) -> bool
true
if the given item is present in this iterator. Read moresource§fn all_unique(&mut self) -> bool
fn all_unique(&mut self) -> bool
source§fn dropping(self, n: usize) -> Selfwhere
Self: Sized,
fn dropping(self, n: usize) -> Selfwhere
Self: Sized,
n
elements from the iterator eagerly,
and return the same iterator again. Read moresource§fn dropping_back(self, n: usize) -> Selfwhere
Self: Sized + DoubleEndedIterator,
fn dropping_back(self, n: usize) -> Selfwhere
Self: Sized + DoubleEndedIterator,
n
elements from the iterator eagerly,
and return the same iterator again. Read moresource§fn foreach<F>(self, f: F)
fn foreach<F>(self, f: F)
f
eagerly on each element of the iterator. Read moresource§fn collect_vec(self) -> Vec<Self::Item>where
Self: Sized,
fn collect_vec(self) -> Vec<Self::Item>where
Self: Sized,
.collect_vec()
is simply a type specialization of Iterator::collect
,
for convenience.source§fn try_collect<T, U, E>(self) -> Result<U, E>
fn try_collect<T, U, E>(self) -> Result<U, E>
source§fn set_from<'a, A, J>(&mut self, from: J) -> usize
fn set_from<'a, A, J>(&mut self, from: J) -> usize
self
from the from
iterator,
stopping at the shortest of the two iterators. Read moresource§fn join(&mut self, sep: &str) -> String
fn join(&mut self, sep: &str) -> String
sep
. Read moresource§fn format(self, sep: &str) -> Format<'_, Self>where
Self: Sized,
fn format(self, sep: &str) -> Format<'_, Self>where
Self: Sized,
sep
. Read moresource§fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>
fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>
sep
. Read moresource§fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
.fold_ok()
.source§fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
Result
values from an iterator. Read moresource§fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>
fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>
Option
values from an iterator. Read moresource§fn fold1<F>(self, f: F) -> Option<Self::Item>
fn fold1<F>(self, f: F) -> Option<Self::Item>
Iterator::reduce
insteadsource§fn tree_fold1<F>(self, f: F) -> Option<Self::Item>
fn tree_fold1<F>(self, f: F) -> Option<Self::Item>
source§fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>
fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>
source§fn sum1<S>(self) -> Option<S>
fn sum1<S>(self) -> Option<S>
source§fn product1<P>(self) -> Option<P>
fn product1<P>(self) -> Option<P>
source§fn sorted_unstable(self) -> IntoIter<Self::Item>
fn sorted_unstable(self) -> IntoIter<Self::Item>
source§fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item>
fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item>
source§fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn sorted(self) -> IntoIter<Self::Item>
fn sorted(self) -> IntoIter<Self::Item>
source§fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item>
fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item>
source§fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn k_smallest(self, k: usize) -> IntoIter<Self::Item>
fn k_smallest(self, k: usize) -> IntoIter<Self::Item>
source§fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)
fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)
Iterator::partition
, each partition may
have a distinct type. Read moresource§fn partition_result<A, B, T, E>(self) -> (A, B)
fn partition_result<A, B, T, E>(self) -> (A, B)
Result
s into one list of all the Ok
elements
and another list of all the Err
elements. Read moresource§fn into_group_map<K, V>(self) -> HashMap<K, Vec<V>>
fn into_group_map<K, V>(self) -> HashMap<K, Vec<V>>
HashMap
of keys mapped to Vec
s of values. Keys and values
are taken from (Key, Value)
tuple pairs yielded by the input iterator. Read moresource§fn into_group_map_by<K, V, F>(self, f: F) -> HashMap<K, Vec<V>>
fn into_group_map_by<K, V, F>(self, f: F) -> HashMap<K, Vec<V>>
Iterator
on a HashMap
. Keys mapped to Vec
s of values. The key is specified
in the closure. Read moresource§fn into_grouping_map<K, V>(self) -> GroupingMap<Self>
fn into_grouping_map<K, V>(self) -> GroupingMap<Self>
GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read moresource§fn into_grouping_map_by<K, V, F>(
self,
key_mapper: F,
) -> GroupingMap<MapForGrouping<Self, F>>
fn into_grouping_map_by<K, V, F>( self, key_mapper: F, ) -> GroupingMap<MapForGrouping<Self, F>>
GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read moresource§fn min_set_by<F>(self, compare: F) -> Vec<Self::Item>
fn min_set_by<F>(self, compare: F) -> Vec<Self::Item>
source§fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
source§fn max_set_by<F>(self, compare: F) -> Vec<Self::Item>
fn max_set_by<F>(self, compare: F) -> Vec<Self::Item>
source§fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
source§fn minmax(self) -> MinMaxResult<Self::Item>
fn minmax(self) -> MinMaxResult<Self::Item>
source§fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>
fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>
source§fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>
fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>
source§fn position_max(self) -> Option<usize>
fn position_max(self) -> Option<usize>
source§fn position_max_by_key<K, F>(self, key: F) -> Option<usize>
fn position_max_by_key<K, F>(self, key: F) -> Option<usize>
source§fn position_max_by<F>(self, compare: F) -> Option<usize>
fn position_max_by<F>(self, compare: F) -> Option<usize>
source§fn position_min(self) -> Option<usize>
fn position_min(self) -> Option<usize>
source§fn position_min_by_key<K, F>(self, key: F) -> Option<usize>
fn position_min_by_key<K, F>(self, key: F) -> Option<usize>
source§fn position_min_by<F>(self, compare: F) -> Option<usize>
fn position_min_by<F>(self, compare: F) -> Option<usize>
source§fn position_minmax(self) -> MinMaxResult<usize>
fn position_minmax(self) -> MinMaxResult<usize>
source§fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>
fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>
source§fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>
fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>
source§fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where
Self: Sized,
fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where
Self: Sized,
source§fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where
Self: Sized,
fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where
Self: Sized,
source§fn multipeek(self) -> MultiPeek<Self>where
Self: Sized,
fn multipeek(self) -> MultiPeek<Self>where
Self: Sized,
.next()
values without advancing the base iterator. Read moresource§fn counts(self) -> HashMap<Self::Item, usize>
fn counts(self) -> HashMap<Self::Item, usize>
HashMap
which
contains each item that appears in the iterator and the number
of times it appears. Read moresource§fn counts_by<K, F>(self, f: F) -> HashMap<K, usize>
fn counts_by<K, F>(self, f: F) -> HashMap<K, usize>
HashMap
which
contains each item that appears in the iterator and the number
of times it appears,
determining identity using a keying function. Read moresource§fn multiunzip<FromI>(self) -> FromIwhere
Self: Sized + MultiUnzip<FromI>,
fn multiunzip<FromI>(self) -> FromIwhere
Self: Sized + MultiUnzip<FromI>,
source§impl<T> Itertools for T
impl<T> Itertools for T
source§fn interleave<J>(
self,
other: J,
) -> Interleave<Self, <J as IntoIterator>::IntoIter>
fn interleave<J>( self, other: J, ) -> Interleave<Self, <J as IntoIterator>::IntoIter>
source§fn interleave_shortest<J>(
self,
other: J,
) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>
fn interleave_shortest<J>( self, other: J, ) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>
source§fn intersperse(
self,
element: Self::Item,
) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>
fn intersperse( self, element: Self::Item, ) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>
source§fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>
fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>
source§fn get<R>(self, index: R) -> <R as IteratorIndex<Self>>::Outputwhere
Self: Sized,
R: IteratorIndex<Self>,
fn get<R>(self, index: R) -> <R as IteratorIndex<Self>>::Outputwhere
Self: Sized,
R: IteratorIndex<Self>,
source§fn zip_longest<J>(
self,
other: J,
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
fn zip_longest<J>(
self,
other: J,
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
source§fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where
J: IntoIterator,
Self: Sized,
source§fn batching<B, F>(self, f: F) -> Batching<Self, F>
fn batching<B, F>(self, f: F) -> Batching<Self, F>
source§fn chunk_by<K, F>(self, key: F) -> ChunkBy<K, Self, F>
fn chunk_by<K, F>(self, key: F) -> ChunkBy<K, Self, F>
source§fn group_by<K, F>(self, key: F) -> ChunkBy<K, Self, F>
fn group_by<K, F>(self, key: F) -> ChunkBy<K, Self, F>
.chunk_by()
.source§fn chunks(self, size: usize) -> IntoChunks<Self>where
Self: Sized,
fn chunks(self, size: usize) -> IntoChunks<Self>where
Self: Sized,
source§fn tuple_windows<T>(self) -> TupleWindows<Self, T>where
Self: Sized + Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
fn tuple_windows<T>(self) -> TupleWindows<Self, T>where
Self: Sized + Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
source§fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where
Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where
Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
source§fn tuples<T>(self) -> Tuples<Self, T>
fn tuples<T>(self) -> Tuples<Self, T>
source§fn tee(self) -> (Tee<Self>, Tee<Self>)
fn tee(self) -> (Tee<Self>, Tee<Self>)
source§fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>
fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>
source§fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>
Result::Ok
value. Result::Err
values are
unchanged. Read moresource§fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>
fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>
Result::Ok
value with the provided closure. Result::Err
values are
unchanged. Read moresource§fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>
fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>
Result::Ok
value with the provided closure. Result::Err
values are unchanged. Read moresource§fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>
fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>
Result::Ok
value into
a series of Result::Ok
values. Result::Err
values are unchanged. Read moresource§fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>
fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>
Result
values instead. Read moresource§fn merge<J>(
self,
other: J,
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>
fn merge<J>( self, other: J, ) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>
source§fn merge_by<J, F>(
self,
other: J,
is_first: F,
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>
fn merge_by<J, F>( self, other: J, is_first: F, ) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>
source§fn merge_join_by<J, F, T>(
self,
other: J,
cmp_fn: F,
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeFuncLR<F, <F as FuncLR<Self::Item, <<J as IntoIterator>::IntoIter as Iterator>::Item>>::T>>
fn merge_join_by<J, F, T>( self, other: J, cmp_fn: F, ) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeFuncLR<F, <F as FuncLR<Self::Item, <<J as IntoIterator>::IntoIter as Iterator>::Item>>::T>>
source§fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>
fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>
source§fn kmerge_by<F>(
self,
first: F,
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where
Self: Sized,
Self::Item: IntoIterator,
F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
fn kmerge_by<F>(
self,
first: F,
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where
Self: Sized,
Self::Item: IntoIterator,
F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
source§fn cartesian_product<J>(
self,
other: J,
) -> Product<Self, <J as IntoIterator>::IntoIter>
fn cartesian_product<J>( self, other: J, ) -> Product<Self, <J as IntoIterator>::IntoIter>
self
and J
. Read moresource§fn multi_cartesian_product(
self,
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where
Self: Sized,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
fn multi_cartesian_product(
self,
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where
Self: Sized,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
self
. Read moresource§fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, NoCount>
fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, NoCount>
source§fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, NoCount>
fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, NoCount>
source§fn dedup_by<Cmp>(
self,
cmp: Cmp,
) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, NoCount>
fn dedup_by<Cmp>( self, cmp: Cmp, ) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, NoCount>
source§fn dedup_with_count(
self,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, WithCount>where
Self: Sized,
fn dedup_with_count(
self,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, WithCount>where
Self: Sized,
source§fn dedup_by_with_count<Cmp>(
self,
cmp: Cmp,
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, WithCount>
fn dedup_by_with_count<Cmp>( self, cmp: Cmp, ) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, WithCount>
source§fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>
fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>
source§fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>
fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>
source§fn unique(self) -> Unique<Self>
fn unique(self) -> Unique<Self>
source§fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>
fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>
source§fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>
fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>
accept
returns true
. Read moresource§fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>
fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>
Clone
-able iterator
to only pick off elements while the predicate accept
returns true
. Read moresource§fn take_while_inclusive<F>(self, accept: F) -> TakeWhileInclusive<Self, F>
fn take_while_inclusive<F>(self, accept: F) -> TakeWhileInclusive<Self, F>
true
, including the element for which the predicate
first returned false
. Read moresource§fn while_some<A>(self) -> WhileSome<Self>
fn while_some<A>(self) -> WhileSome<Self>
Option<A>
iterator elements
and produces A
. Stops on the first None
encountered. Read moresource§fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
source§fn combinations(self, k: usize) -> Combinations<Self>
fn combinations(self, k: usize) -> Combinations<Self>
k
-length combinations of
the elements from an iterator. Read moresource§fn combinations_with_replacement(
self,
k: usize,
) -> CombinationsWithReplacement<Self>
fn combinations_with_replacement( self, k: usize, ) -> CombinationsWithReplacement<Self>
k
-length combinations of
the elements from an iterator, with replacement. Read moresource§fn permutations(self, k: usize) -> Permutations<Self>
fn permutations(self, k: usize) -> Permutations<Self>
source§fn powerset(self) -> Powerset<Self>
fn powerset(self) -> Powerset<Self>
source§fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>
fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>
min
by filling missing elements using a closure f
. Read moresource§fn with_position(self) -> WithPosition<Self>where
Self: Sized,
fn with_position(self) -> WithPosition<Self>where
Self: Sized,
Position
to
ease special-case handling of the first or last elements. Read moresource§fn positions<P>(self, predicate: P) -> Positions<Self, P>
fn positions<P>(self, predicate: P) -> Positions<Self, P>
source§fn update<F>(self, updater: F) -> Update<Self, F>
fn update<F>(self, updater: F) -> Update<Self, F>
source§fn next_tuple<T>(&mut self) -> Option<T>
fn next_tuple<T>(&mut self) -> Option<T>
source§fn collect_tuple<T>(self) -> Option<T>
fn collect_tuple<T>(self) -> Option<T>
source§fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>
fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>
source§fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>
fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>
source§fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>
fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>
source§fn contains<Q>(&mut self, query: &Q) -> bool
fn contains<Q>(&mut self, query: &Q) -> bool
true
if the given item is present in this iterator. Read moresource§fn all_equal_value(
&mut self,
) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>
fn all_equal_value( &mut self, ) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>
source§fn all_unique(&mut self) -> bool
fn all_unique(&mut self) -> bool
source§fn dropping(self, n: usize) -> Selfwhere
Self: Sized,
fn dropping(self, n: usize) -> Selfwhere
Self: Sized,
n
elements from the iterator eagerly,
and return the same iterator again. Read moresource§fn dropping_back(self, n: usize) -> Selfwhere
Self: Sized + DoubleEndedIterator,
fn dropping_back(self, n: usize) -> Selfwhere
Self: Sized + DoubleEndedIterator,
n
elements from the iterator eagerly,
and return the same iterator again. Read moresource§fn collect_vec(self) -> Vec<Self::Item>where
Self: Sized,
fn collect_vec(self) -> Vec<Self::Item>where
Self: Sized,
.collect_vec()
is simply a type specialization of Iterator::collect
,
for convenience.source§fn try_collect<T, U, E>(self) -> Result<U, E>
fn try_collect<T, U, E>(self) -> Result<U, E>
source§fn set_from<'a, A, J>(&mut self, from: J) -> usize
fn set_from<'a, A, J>(&mut self, from: J) -> usize
self
from the from
iterator,
stopping at the shortest of the two iterators. Read moresource§fn format(self, sep: &str) -> Format<'_, Self>where
Self: Sized,
fn format(self, sep: &str) -> Format<'_, Self>where
Self: Sized,
sep
. Read moresource§fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>
fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>
sep
. Read moresource§fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>
Result
values from an iterator. Read moresource§fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>
fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>
Option
values from an iterator. Read moresource§fn fold1<F>(self, f: F) -> Option<Self::Item>
fn fold1<F>(self, f: F) -> Option<Self::Item>
Iterator::reduce
insteadsource§fn tree_reduce<F>(self, f: F) -> Option<Self::Item>
fn tree_reduce<F>(self, f: F) -> Option<Self::Item>
source§fn tree_fold1<F>(self, f: F) -> Option<Self::Item>
fn tree_fold1<F>(self, f: F) -> Option<Self::Item>
.tree_reduce()
.source§fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>
fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>
source§fn sum1<S>(self) -> Option<S>
fn sum1<S>(self) -> Option<S>
source§fn product1<P>(self) -> Option<P>
fn product1<P>(self) -> Option<P>
source§fn sorted_unstable(self) -> IntoIter<Self::Item>
fn sorted_unstable(self) -> IntoIter<Self::Item>
source§fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item>
fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item>
source§fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn sorted(self) -> IntoIter<Self::Item>
fn sorted(self) -> IntoIter<Self::Item>
source§fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item>
fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item>
source§fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item>
fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item>
source§fn k_smallest(self, k: usize) -> IntoIter<Self::Item>
fn k_smallest(self, k: usize) -> IntoIter<Self::Item>
source§fn k_smallest_by<F>(self, k: usize, cmp: F) -> IntoIter<Self::Item>
fn k_smallest_by<F>(self, k: usize, cmp: F) -> IntoIter<Self::Item>
source§fn k_smallest_by_key<F, K>(self, k: usize, key: F) -> IntoIter<Self::Item>
fn k_smallest_by_key<F, K>(self, k: usize, key: F) -> IntoIter<Self::Item>
source§fn k_largest(self, k: usize) -> IntoIter<Self::Item>
fn k_largest(self, k: usize) -> IntoIter<Self::Item>
source§fn k_largest_by<F>(self, k: usize, cmp: F) -> IntoIter<Self::Item>
fn k_largest_by<F>(self, k: usize, cmp: F) -> IntoIter<Self::Item>
source§fn k_largest_by_key<F, K>(self, k: usize, key: F) -> IntoIter<Self::Item>
fn k_largest_by_key<F, K>(self, k: usize, key: F) -> IntoIter<Self::Item>
source§fn tail(self, n: usize) -> IntoIter<Self::Item>where
Self: Sized,
fn tail(self, n: usize) -> IntoIter<Self::Item>where
Self: Sized,
n
elements. Read moresource§fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)
fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)
Iterator::partition
, each partition may
have a distinct type. Read moresource§fn partition_result<A, B, T, E>(self) -> (A, B)
fn partition_result<A, B, T, E>(self) -> (A, B)
Result
s into one list of all the Ok
elements
and another list of all the Err
elements. Read moresource§fn into_group_map<K, V>(self) -> HashMap<K, Vec<V>>
fn into_group_map<K, V>(self) -> HashMap<K, Vec<V>>
HashMap
of keys mapped to Vec
s of values. Keys and values
are taken from (Key, Value)
tuple pairs yielded by the input iterator. Read moresource§fn into_group_map_by<K, V, F>(self, f: F) -> HashMap<K, Vec<V>>
fn into_group_map_by<K, V, F>(self, f: F) -> HashMap<K, Vec<V>>
Iterator
on a HashMap
. Keys mapped to Vec
s of values. The key is specified
in the closure. Read moresource§fn into_grouping_map<K, V>(self) -> GroupingMap<Self>
fn into_grouping_map<K, V>(self) -> GroupingMap<Self>
GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read moresource§fn into_grouping_map_by<K, V, F>(
self,
key_mapper: F,
) -> GroupingMap<MapSpecialCase<Self, GroupingMapFn<F>>>
fn into_grouping_map_by<K, V, F>( self, key_mapper: F, ) -> GroupingMap<MapSpecialCase<Self, GroupingMapFn<F>>>
GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read moresource§fn min_set_by<F>(self, compare: F) -> Vec<Self::Item>
fn min_set_by<F>(self, compare: F) -> Vec<Self::Item>
source§fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
source§fn max_set_by<F>(self, compare: F) -> Vec<Self::Item>
fn max_set_by<F>(self, compare: F) -> Vec<Self::Item>
source§fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
source§fn minmax(self) -> MinMaxResult<Self::Item>
fn minmax(self) -> MinMaxResult<Self::Item>
source§fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>
fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>
source§fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>
fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>
source§fn position_max(self) -> Option<usize>
fn position_max(self) -> Option<usize>
source§fn position_max_by_key<K, F>(self, key: F) -> Option<usize>
fn position_max_by_key<K, F>(self, key: F) -> Option<usize>
source§fn position_max_by<F>(self, compare: F) -> Option<usize>
fn position_max_by<F>(self, compare: F) -> Option<usize>
source§fn position_min(self) -> Option<usize>
fn position_min(self) -> Option<usize>
source§fn position_min_by_key<K, F>(self, key: F) -> Option<usize>
fn position_min_by_key<K, F>(self, key: F) -> Option<usize>
source§fn position_min_by<F>(self, compare: F) -> Option<usize>
fn position_min_by<F>(self, compare: F) -> Option<usize>
source§fn position_minmax(self) -> MinMaxResult<usize>
fn position_minmax(self) -> MinMaxResult<usize>
source§fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>
fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>
source§fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>
fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>
source§fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where
Self: Sized,
fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where
Self: Sized,
source§fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where
Self: Sized,
fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where
Self: Sized,
Ok(None)
will be returned. If the iterator yields
exactly one element, that element will be returned, otherwise an error will be returned
containing an iterator that has the same output as the input iterator. Read moresource§fn multipeek(self) -> MultiPeek<Self>where
Self: Sized,
fn multipeek(self) -> MultiPeek<Self>where
Self: Sized,
.next()
values without advancing the base iterator. Read moresource§fn counts(self) -> HashMap<Self::Item, usize>
fn counts(self) -> HashMap<Self::Item, usize>
HashMap
which
contains each item that appears in the iterator and the number
of times it appears. Read moresource§fn counts_by<K, F>(self, f: F) -> HashMap<K, usize>
fn counts_by<K, F>(self, f: F) -> HashMap<K, usize>
HashMap
which
contains each item that appears in the iterator and the number
of times it appears,
determining identity using a keying function. Read more