Rust · Trait
Iterator
Iterator is Rust's main trait for producing values one at a time. An implementation defines Item and next; next advances the iterator and returns Some(value) or None.
Last updated
- Since
- 1.0.0
Syntax
pub trait Iterator {
type Item;
fn next(&mut self) -> Option<Self::Item>;
}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
IntoIteratorDoubleEndedIteratorExactSizeIteratorOptioncollectmapfiltertake