[src]

Trait std::iter::CloneableIterator

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

A trait for iterators that are cloneable.

Required Methods

fn cycle(self) -> Cycle<Self>

Repeats an iterator endlessly

Example

use std::iter::{CloneableIterator, count};

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