Trait std::iter::ExactSizeExperimental
[-]
[+]
[src]
pub trait ExactSize<A>: DoubleEndedIterator<A> {
fn rposition(&mut self, predicate: |A| -> bool) -> Option<uint> { ... }
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(&mut self, predicate: |A| -> bool) -> Option<uint>
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<A, T: ExactSize<A>> ExactSize<(uint, A)> for Enumerate<T>impl<'a, A, T: ExactSize<A>> ExactSize<A> for Inspect<'a, A, T>impl<A, T: ExactSize<A>> ExactSize<A> for Rev<T>impl<'a, A, B, T: ExactSize<A>> ExactSize<B> for Map<'a, A, B, T>impl<A, B, T: ExactSize<A>, U: ExactSize<B>> ExactSize<(A, B)> for Zip<T, U>impl<A: Clone, D: Deref<A>, I: ExactSize<D>> ExactSize<A> for Cloned<I>impl<A> ExactSize<A> for Item<A>impl<A> ExactSize<A> for Item<A>impl<'a, T> ExactSize<&'a T> for Items<'a, T>impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T>impl<'a> ExactSize<bool> for Bits<'a>impl<'a, K, V> ExactSize<(&'a K, &'a V)> for Entries<'a, K, V>impl<'a, K, V> ExactSize<(&'a K, &'a mut V)> for MutEntries<'a, K, V>impl<K, V> ExactSize<(K, V)> for MoveEntries<K, V>impl<'a, A> ExactSize<&'a A> for Items<'a, A>impl<'a, A> ExactSize<&'a mut A> for MutItems<'a, A>impl<'a, T> ExactSize<&'a T> for Items<'a, T>impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T>impl<T> ExactSize<T> for MoveItems<T>