Where does this `Iter` come from?

Digging in osmpbfreader crate, I see this line:

    pub fn iter(&mut self) -> Iter<R> {
        Iter(self.blobs().flat_map(result_blob_into_iter))
    }

and I can't find where Iter comes from. There's no use statement for it. And I can't find it in the standard library: std::iter has Iterator, but not Iter. Searching through the entire package source code, I see Iter used only in these lines.

I did notice in some code that adding a crate to Cargo.toml made something appear in global namespace, but can't remember what it was, and in this package's Cargo.toml nothing seems to be responsible for this.

So, where does Iter come from, and how do I figure it out?

Isn't it defined here?

1 Like

It is indeed, using this macro.

1 Like

I searched for Iter in the documentation you linked and this came up.

1 Like

Indeed. I jumped through this like and thought I was another call of it. Thanks!

I guess you weren't using VSCode with the amazing rust-analyzer extension, because there a simple Ctrl+Click on the Iter will jump right to the definition inside that macro.

1 Like