What is the fully-qualified type name of the value returned by put_back?

79 views Asked by At

I am trying to create a struct that will hold an iterator returned by itertools::put_back. I do not know the type name to use for the struct member.

Here is how I obtain the iterator over a String:

use itertools::put_back; // 0.8.0

fn main() {
    let hello = "Hello world".to_owned();
    let hello_iter = hello.chars();
    let mut putback_iterator = put_back(hello_iter);
}

Here is the struct definition:

pub struct ParserEventIterator {
    char_iter: itertools::PutBack</* What DO I PUT HERE??? */>,
}

What is the type for putback_iterator in this case? I've tried:

itertools::PutBack<<std::string::String as Trait>::IntoIter>
0

There are 0 answers