-
I have just written a custom iterator.
-
I would like to support
peek
on this iterator. -
I found: mod.rs - source
My understanding is that if we have
pub struct MyIter;
impl Iterator for MyIter;
then, if I do Peekable<MyIter>
, it should return to me an Iterator that supports .peek()
Now, unfortunately, the constructor Peekable::new
is not public outside the crate. Thus, how do I construct a Peekable
?