Trait ResettableIterator

Source
pub trait ResettableIterator: Iterator {
    // Required method
    fn reset(&mut self);

    // Provided methods
    fn reset_clone(&self) -> Self
       where Self: Clone { ... }
    fn resettable_map<F, R>(self, callback: F) -> ResettableMap<Self, F> 
       where F: FnMut(Self::Item) -> R,
             Self: Sized { ... }
}
Expand description

A resettable iterator. It means that calling a reset method will set the iterator to the first position

Required Methods§

Source

fn reset(&mut self)

Resets the iterator to its initial state when called

Provided Methods§

Source

fn reset_clone(&self) -> Self
where Self: Clone,

Creates a new iterator from the current one and reset it

Source

fn resettable_map<F, R>(self, callback: F) -> ResettableMap<Self, F>
where F: FnMut(Self::Item) -> R, Self: Sized,

Creates a ResettableMap from the current iterator

Implementors§