Skip to content
masterclass Buddy

Rust · Trait

IntoIterator

IntoIterator defines how a value becomes an iterator. It specifies the yielded item type and the iterator type, and it enables use with for loops.

Last updated

Since
1.0.0

Syntax

pub trait IntoIterator {
    type Item;
    type IntoIter: Iterator<Item = Self::Item>;
    fn into_iter(self) -> Self::IntoIter;
}

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Iterator
  • FromIterator
  • std::vec::IntoIter
  • std::slice::Iter
  • std::slice::IterMut

Source: IntoIterator in std::iter - Rust. Checked 2026-11-03.