iterator adapter
A method that wraps an iterator to change what it produces, like map or filter.
An adapter is a lazy method that takes an iterator and returns a new iterator (map, filter, enumerate, zip, take, skip, flat_map, peekable).
Loading interactive…
Examples
steps.iter().enumerate().filter(|(_, s)| **s >= 10_000)builds a new iterator of(day, steps)pairs; nothing runs until a consumer pulls from it.
See also