Syntax
Iterator Trait
All iterators implement a trait named
Iterator
Iterator methods
next
sum
Methods that produce other Iterators
By their nature iterators are lazy so the following won’t work:
The Iterator must be consumed, using the
collect
method:
Creating your own Iterators