I've found myself in a situation where I want to ask the caller of a function for a type of some sort that implements
IntoIterator<Item = T>, but where I can also borrow the object beforehand and iterate over references to its contents. In other words, an object that has both an
into_iter() and an
iter() method. The reason is that I need to check the contents of the object first and perhaps error out, and if the contents is satisfactory, call another function that wants
IntoIterator<Item = T>.
Unfortunately there is no trait associated with the
iter method, so this doesn't seem possible. Has it ever been considered to make a trait for