pub trait IterExt: Iterator {
// Provided method
fn pure_map<B, F: Fn(Self::Item) -> B>(self, f: F) -> PureMap<Self, F> ⓘ
where Self: Sized { ... }
}
Provided Methods§
Sourcefn pure_map<B, F: Fn(Self::Item) -> B>(self, f: F) -> PureMap<Self, F> ⓘwhere
Self: Sized,
fn pure_map<B, F: Fn(Self::Item) -> B>(self, f: F) -> PureMap<Self, F> ⓘwhere
Self: Sized,
Pure version of Iterator::map that assumes the mapping function does not have side effects. This means that implemented functions (like [Self::count], [Self::nth], …) are allowed to skip calling the mapping function if possible. Iterator::map already does this do some extend, but only for a limited set of functions.