pub struct Index(usize);
pub struct Container {
data: Vec<T>;
}
impl Container {
fn enumerate(&self) -> ??? {
self.data.iter().enumerate().map(|(i, x)| ( Index(i), x ))
}
}
Now, the generated type is something like Map<Enumerate<Iter<...
, but intuitively, I want to use this as a Iter over (Index, T)
. Is there anyway to express the latter in ???
? I.e. I only care that it is an Iter
that generates (Index, T)
; I don't care about the detail that it is via Map, Enumerate, Iter
.