How to use generic associated types GATs

Define a type inside a trait with a generic parameter using the `type Name<'a>` syntax to create a Generic Associated Type.

Use Generic Associated Types (GATs) by defining a type inside a trait with a generic parameter, then implementing that type in an impl block.

trait Iterator {
    type Item<'a> where Self: 'a;
    fn next(&self) -> Option<Self::Item<'_>>;
}

struct MyIter;

impl Iterator for MyIter {
    type Item<'a> = &'a str;
    fn next(&self) -> Option<Self::Item<'_>> { None }
}