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
impl<Idx: Clone + Step> ExactSizeIterator<Idx> for Range<Idx>
impl<A, T: ExactSizeIterator<A>> ExactSizeIterator<(uint, A)> for Enumerate<T>
impl<A, I, F> ExactSizeIterator<A> for Inspect<A, I, F> where I: ExactSizeIterator<A>, F: FnMut(&A)
impl<A, T: ExactSizeIterator<A>> ExactSizeIterator<A> for Rev<T>
impl<A, B, I, F> ExactSizeIterator<B> for Map<A, B, I, F> where I: ExactSizeIterator<A>, F: FnMut(A) -> B
impl<A, B, T, U> ExactSizeIterator<(A, B)> for Zip<T, U> where T: ExactSizeIterator<A>, U: ExactSizeIterator<B>
impl<A: Clone, D: Deref<A>, I: ExactSizeIterator<D>> ExactSizeIterator<A> for Cloned<I>
impl<'a, A> ExactSizeIterator<&'a A> for Iter<'a, A>
impl<'a, A> ExactSizeIterator<&'a mut A> for IterMut<'a, A>
impl<A> ExactSizeIterator<A> for IntoIter<A>
impl<'a, T> ExactSizeIterator<&'a T> for Iter<'a, T>
impl<'a, T> ExactSizeIterator<&'a mut T> for IterMut<'a, T>
impl<T> ExactSizeIterator<T> for IntoIter<T>
impl<'a, T> ExactSizeIterator<&'a T> for Iter<'a, T>
impl<'a, T> ExactSizeIterator<&'a mut T> for IterMut<'a, T>
impl<'a> ExactSizeIterator<u8> for Bytes<'a>