std::iter::FusedIterator - Rust
Description: API documentation for the Rust `FusedIterator` trait in crate `std`.
Keywords: rust, rustlang, rust-lang, FusedIterator

# Trait std::iter::FusedIterator [−] [src]

    pub trait FusedIterator: Iterator { }

🔬 This is a nightly-only experimental API. (`fused` #35602)

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 for some significant optimizations.

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<I> FusedIterator for Utf16Encoder<I> where
  I: FusedIterator<Item = char>,`
- `impl FusedIterator for ToUppercase`
- `impl<'a> FusedIterator for SplitWhitespace<'a>`
- `impl FusedIterator for ToLowercase`
- `impl FusedIterator for EscapeDebug`
- `impl<I, P> FusedIterator for SkipWhile<I, P> where
  I: FusedIterator,
  P: FnMut(&<I as Iterator>::Item) -> bool,`
- `impl<A> FusedIterator for RangeFrom<A> where
  A: Step,`
- `impl<I> FusedIterator for Enumerate<I> where
  I: FusedIterator,`
- `impl<'a, P> FusedIterator for RMatches<'a, P> where
  P: Pattern<'a>,
  <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,`
- `impl<I> FusedIterator for Cycle<I> where
  I: Clone + Iterator,`
- `impl<A, B> FusedIterator for Chain<A, B> where
  A: FusedIterator,
  B: FusedIterator<Item = <A as Iterator>::Item>,`
- `impl<I, U, F> FusedIterator for FlatMap<I, U, F> where
  F: FnMut(<I as Iterator>::Item) -> U,
  I: FusedIterator,
  U: IntoIterator,`
- `impl<'a, T> FusedIterator for std::result::IterMut<'a, T>`
- `impl<T> FusedIterator for std::result::IntoIter<T>`
- `impl<B, I, F> FusedIterator for Map<I, F> where
  F: FnMut(<I as Iterator>::Item) -> B,
  I: FusedIterator,`
- `impl<A> FusedIterator for std::ops::Range<A> where
  A: Step,`
- `impl<T> FusedIterator for Empty<T>`
- `impl<'a, P> FusedIterator for SplitTerminator<'a, P> where
  P: Pattern<'a>,`
- `impl<'a, P> FusedIterator for std::str::RSplit<'a, P> where
  P: Pattern<'a>,
  <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,`
- `impl<I> FusedIterator for Rev<I> where
  I: FusedIterator + DoubleEndedIterator,`
- `impl<I, F> FusedIterator for Inspect<I, F> where
  F: FnMut(&<I as Iterator>::Item) -> (),
  I: FusedIterator,`
- `impl<'a, A> FusedIterator for std::option::IterMut<'a, A>`
- `impl<'a> FusedIterator for Bytes<'a>`
- `impl<I> FusedIterator for DecodeUtf8<I> where
  I: FusedIterator<Item = u8>,`
- `impl<I> FusedIterator for Skip<I> where
  I: FusedIterator,`
- `impl<'a, P> FusedIterator for std::str::SplitN<'a, P> where
  P: Pattern<'a>,`
- `impl<'a, P> FusedIterator for RSplitTerminator<'a, P> where
  P: Pattern<'a>,
  <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,`
- `impl<I> FusedIterator for Take<I> where
  I: FusedIterator,`
- `impl<A> FusedIterator for Repeat<A> where
  A: Clone,`
- `impl<'a, T> FusedIterator for std::slice::Iter<'a, T>`
- `impl<'a, T> FusedIterator for std::result::Iter<'a, T>`
- `impl FusedIterator for EscapeUnicode`
- `impl<'a> FusedIterator for CharIndices<'a>`
- `impl<'a, P> FusedIterator for RMatchIndices<'a, P> where
  P: Pattern<'a>,
  <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,`
- `impl<B, I, F> FusedIterator for FilterMap<I, F> where
  F: FnMut(<I as Iterator>::Item) -> Option<B>,
  I: FusedIterator,`
- `impl<'a, P> FusedIterator for std::str::RSplitN<'a, P> where
  P: Pattern<'a>,
  <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,`
- `impl<'a> FusedIterator for LinesAny<'a>`
- `impl<'a, T, P> FusedIterator for std::slice::RSplitN<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<'a, T, P> FusedIterator for std::slice::RSplit<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<I> FusedIterator for Fuse<I> where
  I: Iterator,`
- `impl<'a, A> FusedIterator for std::option::Iter<'a, A>`
- `impl<'a, I> FusedIterator for &'a mut I where
  I: FusedIterator + ?Sized,`
- `impl<T> FusedIterator for Once<T>`
- `impl<'a, I, T> FusedIterator for Cloned<I> where
  I: FusedIterator<Item = &'a T>,
  T: 'a + Clone,`
- `impl<'a, T, P> FusedIterator for SplitNMut<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<'a, T> FusedIterator for ChunksMut<'a, T>`
- `impl<'a> FusedIterator for Chars<'a>`
- `impl<'a, T, P> FusedIterator for RSplitNMut<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<'a, T> FusedIterator for std::slice::IterMut<'a, T>`
- `impl<'a, T, P> FusedIterator for RSplitMut<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl FusedIterator for std::char::EscapeDefault`
- `impl<I> FusedIterator for Peekable<I> where
  I: FusedIterator,`
- `impl<A> FusedIterator for std::option::IntoIter<A>`
- `impl<A> FusedIterator for RangeInclusive<A> where
  A: Step,`
- `impl<'a, T> FusedIterator for Windows<'a, T>`
- `impl<'a, T, P> FusedIterator for std::slice::SplitN<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<'a, T> FusedIterator for Chunks<'a, T>`
- `impl<I, P> FusedIterator for TakeWhile<I, P> where
  I: FusedIterator,
  P: FnMut(&<I as Iterator>::Item) -> bool,`
- `impl<'a, P> FusedIterator for MatchIndices<'a, P> where
  P: Pattern<'a>,`
- `impl<A, B> FusedIterator for Zip<A, B> where
  A: FusedIterator,
  B: FusedIterator,`
- `impl<'a, T, P> FusedIterator for SplitMut<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<I, P> FusedIterator for Filter<I, P> where
  I: FusedIterator,
  P: FnMut(&<I as Iterator>::Item) -> bool,`
- `impl<'a> FusedIterator for Lines<'a>`
- `impl<'a, T, P> FusedIterator for std::slice::Split<'a, T, P> where
  P: FnMut(&T) -> bool,`
- `impl<'a, P> FusedIterator for std::str::Split<'a, P> where
  P: Pattern<'a>,`
- `impl<'a, P> FusedIterator for Matches<'a, P> where
  P: Pattern<'a>,`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::IterMut<'a, K, V>`
- `impl<'a, T> FusedIterator for std::collections::vec_deque::Iter<'a, T>`
- `impl<'a, T> FusedIterator for std::collections::btree_set::SymmetricDifference<'a, T> where
  T: Ord,`
- `impl<T> FusedIterator for std::collections::btree_set::IntoIter<T>`
- `impl<'a, T> FusedIterator for std::collections::binary_heap::Iter<'a, T>`
- `impl<'a, T> FusedIterator for std::collections::btree_set::Difference<'a, T> where
  T: Ord,`
- `impl<'a, T> FusedIterator for std::collections::linked_list::Iter<'a, T>`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::Iter<'a, K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::Range<'a, K, V>`
- `impl<I> FusedIterator for Box<I> where
  I: FusedIterator + ?Sized,`
- `impl<'a, T> FusedIterator for std::collections::linked_list::IterMut<'a, T>`
- `impl<T> FusedIterator for std::collections::vec_deque::IntoIter<T>`
- `impl<'a, K, V> FusedIterator for RangeMut<'a, K, V>`
- `impl<'a, T> FusedIterator for std::collections::btree_set::Intersection<'a, T> where
  T: Ord,`
- `impl<'a, T> FusedIterator for std::collections::vec_deque::IterMut<'a, T>`
- `impl<'a> FusedIterator for EncodeUtf16<'a>`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::ValuesMut<'a, K, V>`
- `impl<'a, T> FusedIterator for std::collections::vec_deque::Drain<'a, T> where
  T: 'a,`
- `impl<'a, T> FusedIterator for std::collections::btree_set::Union<'a, T> where
  T: Ord,`
- `impl<'a> FusedIterator for std::string::Drain<'a>`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::Values<'a, K, V>`
- `impl<K, V> FusedIterator for std::collections::btree_map::IntoIter<K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::btree_map::Keys<'a, K, V>`
- `impl<T> FusedIterator for std::collections::binary_heap::IntoIter<T>`
- `impl<T> FusedIterator for std::vec::IntoIter<T>`
- `impl<'a, T> FusedIterator for std::vec::Drain<'a, T>`
- `impl<'a, T> FusedIterator for std::collections::btree_set::Iter<'a, T>`
- `impl<T> FusedIterator for std::collections::linked_list::IntoIter<T>`
- `impl<'a, T> FusedIterator for std::collections::binary_heap::Drain<'a, T> where
  T: 'a,`
- `impl<'a, T> FusedIterator for std::collections::btree_set::Range<'a, T>`
- `impl FusedIterator for std::ascii::EscapeDefault`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::Iter<'a, K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::IterMut<'a, K, V>`
- `impl<K, V> FusedIterator for std::collections::hash_map::IntoIter<K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::Keys<'a, K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::Values<'a, K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::ValuesMut<'a, K, V>`
- `impl<'a, K, V> FusedIterator for std::collections::hash_map::Drain<'a, K, V>`
- `impl<'a, K> FusedIterator for std::collections::hash_set::Iter<'a, K>`
- `impl<K> FusedIterator for std::collections::hash_set::IntoIter<K>`
- `impl<'a, K> FusedIterator for std::collections::hash_set::Drain<'a, K>`
- `impl<'a, T, S> FusedIterator for std::collections::hash_set::Intersection<'a, T, S> where
  T: Eq + Hash,
  S: BuildHasher,`
- `impl<'a, T, S> FusedIterator for std::collections::hash_set::Difference<'a, T, S> where
  T: Eq + Hash,
  S: BuildHasher,`
- `impl<'a, T, S> FusedIterator for std::collections::hash_set::SymmetricDifference<'a, T, S> where
  T: Eq + Hash,
  S: BuildHasher,`
- `impl<'a, T, S> FusedIterator for std::collections::hash_set::Union<'a, T, S> where
  T: Eq + Hash,
  S: BuildHasher,`
- `impl<'a> FusedIterator for std::path::Iter<'a>`
- `impl<'a> FusedIterator for Components<'a>`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)