Rust's ownership model for JavaScript developers
blog.thoughtram.io
blog.thoughtram.io
> impl<'a> ProductService<'a>
I understand why <'a> is here, but why repeated twice?
impl<'a, K, Q: ?Sized, V, S> Index<&'a Q> for HashMap<K, V, S>
where K: Eq + Hash + Borrow<Q>,
Q: Eq + Hash,
S: HashState
Okay, maybe that's not obvious, I picked a really gross example on purpose. :)The first part says "we're generic over five things: 'a, K, Q, V, and S. And then each of those five things gets used various times in the rest of the definition.