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§
Provided Methods§
Sourcefn reset_clone(&self) -> Selfwhere
Self: Clone,
fn reset_clone(&self) -> Selfwhere
Self: Clone,
Creates a new iterator from the current one and reset it
Sourcefn resettable_map<F, R>(self, callback: F) -> ResettableMap<Self, F> ⓘ
fn resettable_map<F, R>(self, callback: F) -> ResettableMap<Self, F> ⓘ
Creates a ResettableMap from the current iterator