Every method in this trait that hands out or consumes references is chained to a specific borrow duration.
1 2 3 4 5 6 7 |
|
1 2 3 |
|
Now the methods in the trait are parameterized with a lifetime parameter. Now we’re saying: “When something implements Named<'a>
, its name()
method gives back a string slice that lives as long as 'a
.”