Lifetimes
Draft
This note is in progress.
TL;DR Lifetimes are the borrow checker's way of tracking how long a reference is valid. In most cases they're inferred. You write them explicitly when the compiler can't figure out the relationship between input and output reference lifetimes.
Planned Coverage
- Lifetime elision rules
- Named lifetimes (
'a) in function signatures - Lifetime bounds on structs
'staticlifetime- Higher-rank trait bounds (HRTB) —
for<'a>