Trait core::iter::IteratorUnstable
[-]
[+]
[src]
pub trait Iterator<A> {
fn next(&mut self) -> Option<A>;
fn size_hint(&self) -> (uint, Option<uint>) { ... }
}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.
Required Methods
fn next(&mut self) -> Option<A>
Advance the iterator and return the next value. Return None when the end is reached.
Provided Methods
fn size_hint(&self) -> (uint, Option<uint>)
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 Iterator<char> for UnicodeEscapedCharsimpl Iterator<char> for DefaultEscapedCharsimpl<A, T: DoubleEndedIterator<A>> Iterator<A> for Rev<T>impl<'a, A, T: Iterator<A> + 'a> Iterator<A> for ByRef<'a, T>impl<A: Clone, D: Deref<A>, I: Iterator<D>> Iterator<A> for Cloned<I>impl<A, T: Clone + Iterator<A>> Iterator<A> for Cycle<T>impl<A, T: Iterator<A>, U: Iterator<A>> Iterator<A> for Chain<T, U>impl<A, B, T: Iterator<A>, U: Iterator<B>> Iterator<(A, B)> for Zip<T, U>impl<'a, A, B, T: Iterator<A>> Iterator<B> for Map<'a, A, B, T>impl<'a, A, T: Iterator<A>> Iterator<A> for Filter<'a, A, T>impl<'a, A, B, T: Iterator<A>> Iterator<B> for FilterMap<'a, A, B, T>impl<A, T: Iterator<A>> Iterator<(uint, A)> for Enumerate<T>impl<A, T: Iterator<A>> Iterator<A> for Peekable<A, T>impl<'a, A, T: Iterator<A>> Iterator<A> for SkipWhile<'a, A, T>impl<'a, A, T: Iterator<A>> Iterator<A> for TakeWhile<'a, A, T>impl<A, T: Iterator<A>> Iterator<A> for Skip<T>impl<A, T: Iterator<A>> Iterator<A> for Take<T>impl<'a, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'a, A, B, T, St>impl<'a, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for FlatMap<'a, A, T, U>impl<A, T: Iterator<A>> Iterator<A> for Fuse<T>impl<'a, A, T: Iterator<A>> Iterator<A> for Inspect<'a, A, T>impl<'a, A, St> Iterator<A> for Unfold<'a, A, St>impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A>impl<A: Int + ToPrimitive> Iterator<A> for Range<A>impl<A: Int + ToPrimitive> Iterator<A> for RangeInclusive<A>impl<A: Int> Iterator<A> for RangeStep<A>impl<A: Int> Iterator<A> for RangeStepInclusive<A>impl<A: Clone> Iterator<A> for Repeat<A>impl<A> Iterator<A> for Item<A>impl<T> Iterator<T> for Item<T>impl<'a, T> Iterator<&'a T> for Items<'a, T>impl<'a, T> Iterator<&'a mut T> for MutItems<'a, T>impl<'a, T> Iterator<&'a [T]> for Splits<'a, T>impl<'a, T> Iterator<&'a mut [T]> for MutSplits<'a, T>impl<E, I: SplitsIter<E>> Iterator<E> for SplitsN<I>impl<'a, T> Iterator<&'a [T]> for Windows<'a, T>impl<'a, T> Iterator<&'a [T]> for Chunks<'a, T>impl<'a, T> Iterator<&'a mut [T]> for MutChunks<'a, T>impl<'a> Iterator<char> for Chars<'a>impl<'a> Iterator<(uint, char)> for CharOffsets<'a>impl<'a, Sep: CharEq> Iterator<&'a str> for CharSplits<'a, Sep>impl<'a, Sep: CharEq> Iterator<&'a str> for CharSplitsN<'a, Sep>impl<'a> Iterator<(uint, uint)> for MatchIndices<'a>impl<'a> Iterator<&'a str> for StrSplits<'a>impl<'a> Iterator<u16> for Utf16CodeUnits<'a>impl<I> Iterator<u16> for Utf16Encoder<I> where I: Iterator<char>impl<'a> Iterator<Utf16Item> for Utf16Items<'a>