Trait core::iter::CloneIteratorExtUnstable
[-]
[+]
[src]
pub trait CloneIteratorExt { fn cycle(self) -> Cycle<Self>; }
An extension trait for cloneable iterators.
Required Methods
fn cycle(self) -> Cycle<Self>
Repeats an iterator endlessly
Example
fn main() { use std::iter::{CloneIteratorExt, count}; let a = count(1i,1i).take(1); let mut cy = a.cycle(); assert_eq!(cy.next(), Some(1)); assert_eq!(cy.next(), Some(1)); }use std::iter::{CloneIteratorExt, count}; let a = count(1i,1i).take(1); let mut cy = a.cycle(); assert_eq!(cy.next(), Some(1)); assert_eq!(cy.next(), Some(1));
Implementors
impl<A, I> CloneIteratorExt for I where I: Iterator<A> + Clone