Trait std::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<Idx: Clone + Step> Iterator<Idx> for Range<Idx>
impl<Idx: Clone + Step> Iterator<Idx> for RangeFrom<Idx>
impl Iterator<char> for EscapeUnicode
impl Iterator<char> for EscapeDefault
impl<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, B, I, F> Iterator<B> for Map<A, B, I, F>
impl<A, I, P> Iterator<A> for Filter<A, I, P>
impl<A, B, I, F> Iterator<B> for FilterMap<A, B, I, F>
impl<A, T: Iterator<A>> Iterator<(uint, A)> for Enumerate<T>
impl<A, T: Iterator<A>> Iterator<A> for Peekable<A, T>
impl<A, I, P> Iterator<A> for SkipWhile<A, I, P>
impl<A, I, P> Iterator<A> for TakeWhile<A, I, P>
impl<A, T: Iterator<A>> Iterator<A> for Skip<T>
impl<A, T: Iterator<A>> Iterator<A> for Take<T>
impl<A, B, I, St, F> Iterator<B> for Scan<A, B, I, St, F>
impl<A, B, I, U, F> Iterator<B> for FlatMap<A, B, I, U, F>
impl<A, T: Iterator<A>> Iterator<A> for Fuse<T>
impl<A, I, F> Iterator<A> for Inspect<A, I, F>
impl<A, St, F> Iterator<A> for Unfold<A, St, F>
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<'a, A> Iterator<&'a A> for Iter<'a, A>
impl<'a, A> Iterator<&'a mut A> for IterMut<'a, A>
impl<A> Iterator<A> for IntoIter<A>
impl<'a, T> Iterator<&'a T> for Iter<'a, T>
impl<'a, T> Iterator<&'a mut T> for IterMut<'a, T>
impl<T> Iterator<T> for IntoIter<T>
impl<'a, T> Iterator<&'a T> for Iter<'a, T>
impl<'a, T> Iterator<&'a mut T> for IterMut<'a, T>
impl<'a, T, P> Iterator<&'a [T]> for Split<'a, T, P>
impl<'a, T, P> Iterator<&'a mut [T]> for SplitMut<'a, T, P>
impl<E, I: SplitIter<E>> Iterator<E> for GenericSplitN<I>
impl<'a, T, P> Iterator<&'a [T]> for SplitN<'a, T, P>
impl<'a, T, P> Iterator<&'a [T]> for RSplitN<'a, T, P>
impl<'a, T, P> Iterator<&'a mut [T]> for SplitNMut<'a, T, P>
impl<'a, T, P> Iterator<&'a mut [T]> for RSplitNMut<'a, T, P>
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 ChunksMut<'a, T>
impl<'a> Iterator<char> for Chars<'a>
impl<'a> Iterator<(uint, char)> for CharIndices<'a>
impl<'a> Iterator<u8> for Bytes<'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 SplitStr<'a>
impl<'a, P: CharEq> Iterator<&'a str> for Split<'a, P>
impl<'a, P: CharEq> Iterator<&'a str> for SplitTerminator<'a, P>
impl<'a, P: CharEq> Iterator<&'a str> for SplitN<'a, P>
impl<'a, P: CharEq> Iterator<&'a str> for RSplitN<'a, P>
impl<'a> Iterator<&'a str> for Lines<'a>
impl<'a> Iterator<&'a str> for LinesAny<'a>
impl<'a> Iterator<c_char> for CChars<'a>
impl<'r, R: Reader> Iterator<IoResult<u8>> for Bytes<'r, R>
impl Iterator<Path> for Directories
impl<'r, T: Buffer> Iterator<IoResult<String>> for Lines<'r, T>
impl<'r, T: Buffer> Iterator<IoResult<char>> for Chars<'r, T>
impl<'a, T, A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A>
impl<'a, T: Rand, R: Rng> Iterator<T> for Generator<'a, T, R>
impl<'a, R: Rng> Iterator<char> for AsciiGenerator<'a, R>
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V>
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V>
impl<K, V> Iterator<(K, V)> for IntoIter<K, V>
impl<'a, K, V> Iterator<&'a K> for Keys<'a, K, V>
impl<'a, K, V> Iterator<&'a V> for Values<'a, K, V>
impl<'a, K: 'a, V: 'a> Iterator<(K, V)> for Drain<'a, K, V>
impl<'a, K> Iterator<&'a K> for Iter<'a, K>
impl<K> Iterator<K> for IntoIter<K>
impl<'a, K: 'a> Iterator<K> for Drain<'a, K>
impl<'a, T, S, H> Iterator<&'a T> for Intersection<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for Difference<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for SymmetricDifference<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for Union<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V>
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V>
impl<K, V> Iterator<(K, V)> for IntoIter<K, V>
impl<'a, K, V> Iterator<&'a K> for Keys<'a, K, V>
impl<'a, K, V> Iterator<&'a V> for Values<'a, K, V>
impl<'a, K: 'a, V: 'a> Iterator<(K, V)> for Drain<'a, K, V>
impl<'a, K> Iterator<&'a K> for Iter<'a, K>
impl<K> Iterator<K> for IntoIter<K>
impl<'a, K: 'a> Iterator<K> for Drain<'a, K>
impl<'a, T, S, H> Iterator<&'a T> for Intersection<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for Difference<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for SymmetricDifference<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T, S, H> Iterator<&'a T> for Union<'a, T, H> where T: Eq + Hash<S>, H: Hasher<S>
impl<'a, T> Iterator<&'a T> for Iter<'a, T>
impl<T> Iterator<T> for IntoIter<T>
impl<'a, T: 'a> Iterator<T> for Drain<'a, T>
impl<'a> Iterator<bool> for Bits<'a>
impl<'a> Iterator<uint> for BitPositions<'a>
impl<'a> Iterator<uint> for TwoBitPositions<'a>
impl<T> Iterator<T> for RawItems<T>
impl<K, V, E, Impl: TraversalImpl<K, V, E>> Iterator<TraversalItem<K, V, E>> for AbsTraversal<Impl>
impl<K, V, E, T: Traverse<E> + DoubleEndedIterator<TraversalItem<K, V, E>>> Iterator<(K, V)> for AbsIter<T>
impl<'a, K, V> Iterator<(&'a K, &'a V)> for Iter<'a, K, V>
impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for IterMut<'a, K, V>
impl<K, V> Iterator<(K, V)> for IntoIter<K, V>
impl<'a, K, V> Iterator<&'a K> for Keys<'a, K, V>
impl<'a, K, V> Iterator<&'a V> for Values<'a, K, V>
impl<'a, T> Iterator<&'a T> for Iter<'a, T>
impl<T> Iterator<T> for IntoIter<T>
impl<'a, T: Ord> Iterator<&'a T> for Difference<'a, T>
impl<'a, T: Ord> Iterator<&'a T> for SymmetricDifference<'a, T>
impl<'a, T: Ord> Iterator<&'a T> for Intersection<'a, T>
impl<'a, T: Ord> Iterator<&'a T> for Union<'a, T>
impl<'a, A> Iterator<&'a A> for Iter<'a, A>
impl<'a, A> Iterator<&'a mut A> for IterMut<'a, A>
impl<A> Iterator<A> for IntoIter<A>
impl<E: CLike> Iterator<E> for Iter<E>
impl<'a, T> Iterator<&'a T> for Iter<'a, T>
impl<'a, T> Iterator<&'a mut T> for IterMut<'a, T>
impl<T> Iterator<T> for IntoIter<T>
impl<'a, T: 'a> Iterator<T> for Drain<'a, T>
impl Iterator<(uint, uint)> for ElementSwaps
impl<T: Clone> Iterator<Vec<T>> for Permutations<T>
impl<'a> Iterator<char> for Decompositions<'a>
impl<'a> Iterator<char> for Recompositions<'a>
impl<'a> Iterator<u16> for Utf16Units<'a>
impl<T> Iterator<T> for IntoIter<T>
impl<'a, T> Iterator<T> for Drain<'a, T>
impl<'a, V> Iterator<(uint, &'a V)> for Iter<'a, V>
impl<'a, V> Iterator<(uint, &'a mut V)> for IterMut<'a, V>
impl<'a, V> Iterator<uint> for Keys<'a, V>
impl<'a, V> Iterator<&'a V> for Values<'a, V>
impl<V> Iterator<(uint, V)> for IntoIter<V>
impl<'a, T: Send> Iterator<T> for Messages<'a, T>
impl<'a> Iterator<(uint, &'a str)> for GraphemeIndices<'a>
impl<'a> Iterator<&'a str> for Graphemes<'a>
impl<'a> Iterator<Utf16Item> for Utf16Items<'a>
impl<I> Iterator<u16> for Utf16Encoder<I>
impl<'a> Iterator<&'a str> for Words<'a>