Skip to content
masterclass Buddy

Rust · Method

Iterator::filter

Filter is an iterator adapter that keeps source items accepted by a predicate. It checks items lazily as the filtered iterator is consumed.

Last updated

Since
1.0.0

Syntax

pub struct Filter<I, P> { /* private fields */ }

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

Subscribe
  • Iterator::filter
  • Iterator
  • DoubleEndedIterator
  • Clone

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