Struct std::option::OptionIterator

pub struct OptionIterator<A> {
    priv opt: Option<A>,
}

An iterator that yields either one or zero elements

Trait Implementations

impl<A: Clone> Clone for OptionIterator<A>

fn clone(&self) -> OptionIterator<A>

Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.

impl<A: DeepClone> DeepClone for OptionIterator<A>

fn deep_clone(&self) -> OptionIterator<A>

Return a deep copy of the value. Unlike Clone, the contents of shared pointer types are copied.

impl<A> Iterator<A> for OptionIterator<A>

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

Advance the iterator and return the next value. Return None when the end is reached.

fn size_hint(&self) -> (uint, Option<uint>)

Return a lower bound and upper bound on the remaining length of the iterator.

The common use case for the estimate is pre-allocating space to store the results.

impl<A> DoubleEndedIterator<A> for OptionIterator<A>

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

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

impl<A> ExactSize<A> for OptionIterator<A>