Struct std::iter::Counter

pub struct Counter<A> {
    state: A,
    step: A,
}

An infinite iterator starting at start and advancing by step with each iteration

Trait Implementations

impl<A: Clone> Clone for Counter<A>

fn clone(&self) -> Counter<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: Add<A, A> + Clone> Iterator<A> for Counter<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.