Trait core::iter::IteratorStable
[-]
[+]
[src]
pub trait Iterator {
type Item;
fn next(&mut self) -> Option<Item>;
fn size_hint(&self) -> (usize, Option<usize>) { ... }
}An interface for dealing with "external iterators". These types of iterators can be resumed at any time as all state is stored internally as opposed to being located on the call stack.
The Iterator protocol states that an iterator yields a (potentially-empty,
potentially-infinite) sequence of values, and returns None to signal that
it's finished. The Iterator protocol does not define behavior after None
is returned. A concrete Iterator implementation may choose to behave however
it wishes, either by returning None infinitely, or by doing something
else.
Associated Types
Required Methods
fn next(&mut self) -> Option<Item>
Advance the iterator and return the next value. Return None when the end is reached.
Provided Methods
fn size_hint(&self) -> (usize, Option<usize>)
Returns a lower and upper bound on the remaining length of the iterator.
An upper bound of None means either there is no known upper bound, or the upper bound
does not fit within a uint.
Implementors
impl<Idx: Clone + Step> Iterator for Range<Idx>impl<Idx: Clone + Step> Iterator for RangeFrom<Idx>impl Iterator for EscapeUnicodeimpl Iterator for EscapeDefaultimpl<I> Iterator for Rev<I> where I: DoubleEndedIteratorimpl<'a, I> Iterator for ByRef<'a, I> where I: 'a + Iteratorimpl<T, D, I> Iterator for Cloned<I> where T: Clone, D: Deref<Target=T>, I: Iterator<Item=D>impl<I> Iterator for Cycle<I> where I: Clone + Iteratorimpl<T, A, B> Iterator for Chain<A, B> where A: Iterator<Item=T>, B: Iterator<Item=T>impl<T, U, A, B> Iterator for Zip<A, B> where A: Iterator<Item=T>, B: Iterator<Item=U>impl<A, B, I, F> Iterator for Map<A, B, I, F> where I: Iterator<Item=A>, F: FnMut(A) -> Bimpl<A, I, P> Iterator for Filter<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> boolimpl<A, B, I, F> Iterator for FilterMap<A, B, I, F> where I: Iterator<Item=A>, F: FnMut(A) -> Option<B>impl<I> Iterator for Enumerate<I> where I: Iteratorimpl<T, I> Iterator for Peekable<T, I> where I: Iterator<Item=T>impl<A, I, P> Iterator for SkipWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> boolimpl<A, I, P> Iterator for TakeWhile<A, I, P> where I: Iterator<Item=A>, P: FnMut(&A) -> boolimpl<I> Iterator for Skip<I> where I: Iteratorimpl<I> Iterator for Take<I> where I: Iteratorimpl<A, B, I, St, F> Iterator for Scan<A, B, I, St, F> where I: Iterator<Item=A>, F: FnMut(&mut St, A) -> Option<B>impl<A, B, I, U, F> Iterator for FlatMap<A, B, I, U, F> where I: Iterator<Item=A>, U: Iterator<Item=B>, F: FnMut(A) -> Uimpl<I> Iterator for Fuse<I> where I: Iteratorimpl<A, I, F> Iterator for Inspect<A, I, F> where I: Iterator<Item=A>, F: FnMut(&A)impl<A, St, F> Iterator for Unfold<A, St, F> where F: FnMut(&mut St) -> Option<A>impl<A: Add<Output=A> + Clone> Iterator for Counter<A>impl<A: Int + ToPrimitive> Iterator for Range<A>impl<A: Int + ToPrimitive> Iterator for RangeInclusive<A>impl<A: Int> Iterator for RangeStep<A>impl<A: Int> Iterator for RangeStepInclusive<A>impl<A: Clone> Iterator for Repeat<A>impl<'a, A> Iterator for Iter<'a, A>impl<'a, A> Iterator for IterMut<'a, A>impl<A> Iterator for IntoIter<A>impl<'a, T> Iterator for Iter<'a, T>impl<'a, T> Iterator for IterMut<'a, T>impl<T> Iterator for IntoIter<T>impl<'a, T> Iterator for Iter<'a, T>impl<'a, T> Iterator for IterMut<'a, T>impl<'a, T, P> Iterator for Split<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T, P> Iterator for SplitMut<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T, P> Iterator for SplitN<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T, P> Iterator for RSplitN<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T, P> Iterator for SplitNMut<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T, P> Iterator for RSplitNMut<'a, T, P> where P: FnMut(&T) -> boolimpl<'a, T> Iterator for Windows<'a, T>impl<'a, T> Iterator for Chunks<'a, T>impl<'a, T> Iterator for ChunksMut<'a, T>impl<'a> Iterator for Chars<'a>impl<'a> Iterator for CharIndices<'a>impl<'a> Iterator for Bytes<'a>impl<'a> Iterator for MatchIndices<'a>impl<'a> Iterator for SplitStr<'a>impl<'a, P: CharEq> Iterator for Split<'a, P>impl<'a, P: CharEq> Iterator for SplitTerminator<'a, P>impl<'a, P: CharEq> Iterator for SplitN<'a, P>impl<'a, P: CharEq> Iterator for RSplitN<'a, P>impl<'a> Iterator for Lines<'a>impl<'a> Iterator for LinesAny<'a>