Struct std::iter::Repeat

pub struct Repeat<A> {
    priv element: A,
}

An iterator that repeats an element endlessly

Methods

impl<A: Clone> Repeat<A>

fn new(elt: A) -> Repeat<A>

Create a new Repeat that endlessly repeats the element elt.

Trait Implementations

impl<A: Clone> Clone for Repeat<A>

fn clone(&self) -> Repeat<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 Repeat<A>

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

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

impl<A: Clone> Iterator<A> for Repeat<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: Clone> DoubleEndedIterator<A> for Repeat<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: Clone> RandomAccessIterator<A> for Repeat<A>

fn indexable(&self) -> uint

Return the number of indexable elements. At most std::uint::max_value elements are indexable, even if the iterator represents a longer range.

fn idx(&self, _: uint) -> Option<A>

Return an element at an index