Trait std::iter::ClonableIterator

pub trait ClonableIterator {
    fn cycle(self) -> Cycle<Self>;
}

A trait for iterators that are clonable.

Required Methods

fn cycle(self) -> Cycle<Self>

Repeats an iterator endlessly

Example

let a = count(1,1).take(1);
let mut cy = a.cycle();
assert_eq!(cy.next(), Some(1));
assert_eq!(cy.next(), Some(1));

Implementors