Trait std::iter::FusedIterator
1.26.0·
source ·
[−]pub trait FusedIterator: Iterator { }
Expand description
An iterator that always continues to yield None
when exhausted.
Calling next on a fused iterator that has returned None
once is guaranteed
to return None
again. This trait should be implemented by all iterators
that behave this way because it allows optimizing Iterator::fuse()
.
Note: In general, you should not use FusedIterator
in generic bounds if
you need a fused iterator. Instead, you should just call Iterator::fuse()
on the iterator. If the iterator is already fused, the additional Fuse
wrapper will be a no-op with no performance penalty.
Implementors
impl<'_, K, V, F> FusedIterator for std::collections::btree_map::DrainFilter<'_, K, V, F> where
F: FnMut(&K, &mut V) -> bool,
impl<'_, T> FusedIterator for std::collections::btree_set::SymmetricDifference<'_, T> where
T: Ord,
impl<'_, T, A> FusedIterator for std::collections::vec_deque::Drain<'_, T, A> where
A: Allocator,
impl<'_, T, F> FusedIterator for std::collections::btree_set::DrainFilter<'_, T, F> where
F: FnMut(&T) -> bool,
1.27.0 · source
impl<'_, T, P> FusedIterator for std::slice::RSplit<'_, T, P> where
P: FnMut(&T) -> bool,
1.51.0 · source
impl<'_, T, P> FusedIterator for std::slice::SplitInclusive<'_, T, P> where
P: FnMut(&T) -> bool,
1.51.0 · source
impl<'_, T, P> FusedIterator for SplitInclusiveMut<'_, T, P> where
P: FnMut(&T) -> bool,
impl<'a, I, T> FusedIterator for Cloned<I> where
T: 'a + Clone,
I: FusedIterator<Item = &'a T>,
1.36.0 · source
impl<'a, I, T> FusedIterator for Copied<I> where
T: 'a + Copy,
I: FusedIterator<Item = &'a T>,
impl<'a, P> FusedIterator for RMatchIndices<'a, P> where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
impl<'a, P> FusedIterator for RMatches<'a, P> where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
impl<'a, P> FusedIterator for std::str::RSplit<'a, P> where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
impl<'a, P> FusedIterator for std::str::RSplitN<'a, P> where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
impl<'a, P> FusedIterator for RSplitTerminator<'a, P> where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
impl<A, B> FusedIterator for Chain<A, B> where
A: FusedIterator,
B: FusedIterator<Item = <A as Iterator>::Item>,
impl<B, I, F> FusedIterator for FilterMap<I, F> where
I: FusedIterator,
F: FnMut(<I as Iterator>::Item) -> Option<B>,
impl<B, I, F> FusedIterator for Map<I, F> where
I: FusedIterator,
F: FnMut(<I as Iterator>::Item) -> B,
impl<I, F> FusedIterator for Inspect<I, F> where
I: FusedIterator,
F: FnMut(&<I as Iterator>::Item),
impl<I, P> FusedIterator for Filter<I, P> where
I: FusedIterator,
P: FnMut(&<I as Iterator>::Item) -> bool,
impl<I, P> FusedIterator for SkipWhile<I, P> where
I: FusedIterator,
P: FnMut(&<I as Iterator>::Item) -> bool,
impl<I, P> FusedIterator for TakeWhile<I, P> where
I: FusedIterator,
P: FnMut(&<I as Iterator>::Item) -> bool,
1.29.0 · source