Implement the Iterator trait for the struct that should serve as iterator. You only need to implement the next method. The other methods have default implementations.
It is not possible to create an iterator that works with any container. The type system machinery needed for this doesn't exist yet.