Trait core::iter::ExactSizeIteratorUnstable [-]  [+] [src]

pub trait ExactSizeIterator<A>: DoubleEndedIterator<A> {
    fn rposition<P>(&mut self, predicate: P) -> Option<uint> where P: FnMut(A) -> bool { ... }
    fn len(&self) -> uint { ... }
}

An iterator that knows its exact length

This trait is a helper for iterators like the vector iterator, so that it can support double-ended enumeration.

Iterator::size_hint must return the exact size of the iterator. Note that the size must fit in uint.

Provided Methods

fn rposition<P>(&mut self, predicate: P) -> Option<uint> where P: FnMut(A) -> bool

Return the index of the last element satisfying the specified predicate

If no element matches, None is returned.

fn len(&self) -> uint

Return the exact length of the iterator.

Implementors