I’ve just started learning Rust and I am playing with the Reqwest
package; I found this line in their source code:
pub fn cookies<'a>(&'a self) -> impl Iterator<Item = cookie::Cookie<'a>> + 'a {
cookie::extract_response_cookies(self.res.headers()).filter_map(Result::ok)
}
What is that lifetime annotation there at the end? i.e., + 'a
after return type annotation? Does it specify the lifetime for the Iterator itself? Or does it mean something else?
I’ve read up on the book and googled for quite some time and I can’t find a good article or explanation for this.
1