The Iterator Trait
when implementing the Iterator trait in Rust, your struct usually needs some form of state to keep track of the iteration’s progress. Often, this is achieved by including a counter or index field in your struct. https://doc.rust-lang.org/stable/book/ch13-02-iterators.html?highlight=iterator%20trait#the-iterator-trait-and-the-next-method Also, check out : https://doc.rust-lang.org/stable/book/ch19-03-advanced-traits.html#specifying-placeholder-types-in-trait-definitions-with-associated-types impl Iterator for Here’s a basic example of how to implement an iterator […]