Rayon parallel iterator is not an iterator?

I'm starting to experiment with the Rayon crate and I'm sure I must be missing something obvious here. If I call par_iter to get one of Rayon's parallel iterators, I can call the usual iterator methods on it (for_each, map, collect...) so it seems to be an iterator. But when I try to use it in a for loop, the compiler insists it is not:

error[E0277]: rayon::range::Iter<{integer}> is not an iterator

What am I missing here?

Aha!

So indeed, despite the name a ParallelIterator is in fact not an Iterator! If you want to turn it back into a normal Iterator, I guess you have to collect() it into a Vec or something like that?

That would be one option. See also this previous topic (I don't think much has changed since then): [rayon] How do I convert a `ParallelIterator` into a regular `Iterator` without collecting it in a `Vec` first?

It's actually a ParallelIterator, which is deliberately similar to Iterator, although some methods are a bit different to support parallel execution. For example, Iterator::map requires only FnMut while ParallelIterator::map requires Fn + Sync + Send.