HasIterator<V> trait?

Is there a way to formulate a trait for "HasIterator" ?


T: HasIterator<V> if and only if T.iter() exists and has type Iterator<Item = V> ?


Context: I am trying to write generic code that says: you can pass any object here where we can call '.iter()" on.

This recent discussion might have some insight for you.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.