Iterators are how Rust does loops without writing loops. The Iterator trait you met in the Traits track powers a whole vocabulary of adapters and consumers that read like a description of what you want, not how to compute it.
Getting an iterator
Three ways to iterate a collection: .iter() yields shared references (&T), .iter_mut() yields mutable references (&mut T), and .into_iter() consumes the collection, yielding owned T. Which you pick is — again — the ownership question: borrow to read, borrow-mut to modify, consume to take ownership.
Adapters vs consumers
Adapters like map, filter, take, skip transform one iterator into another — and they're lazy, doing no work until driven. Consumers like collect, sum, count, fold, or a for loop are what actually pull values through and produce a result. A chain of adapters with no consumer does nothing at all.
v.iter().map(f).filter(g) builds a recipe and runs nothing. Add .collect() or .sum() and the whole chain executes in a single pass, with the adapters fused together — no intermediate vectors, as fast as a hand-written loop.Why prefer iterators over loops
An iterator chain says what you want — 'the squares of the even numbers' — while an index loop says how to compute it, with room for off-by-one bugs. Iterators are also zero-cost: the compiler optimizes a chain down to the same machine code as the hand-written loop, often faster. clippy will actively nudge you from manual loops toward iterator chains.