Skip to content
masterclass Buddy

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.

Subscribe
  • IntoIterator
  • DoubleEndedIterator
  • ExactSizeIterator
  • Option
  • collect
  • map
  • filter
  • take

Source: Iterator in core::iter - Rust. Checked 2026-11-03.