[src]

Trait std::iter::DoubleEndedIterator

pub trait DoubleEndedIterator<A>: Iterator<A> {
    fn next_back(&mut self) -> Option<A>;

    fn rev(self) -> Rev<Self> { ... }
}

A range iterator able to yield elements from both ends

Required Methods

fn next_back(&mut self) -> Option<A>

Yield an element from the end of the range, returning None if the range is empty.

Provided Methods

fn rev(self) -> Rev<Self>

Change the direction of the iterator

The flipped iterator swaps the ends on an iterator that can already be iterated from the front and from the back.

If the iterator also implements RandomAccessIterator, the flipped iterator is also random access, with the indices starting at the back of the original iterator.

Note: Random access with flipped indices still only applies to the first uint::MAX elements of the original iterator.

Implementors