‹ advanced path
Lifetimes
Annotations stop being noise once you read them as a constraint between inputs and outputs. Elision, structs that hold references, 'static, and what a bound really promises.
serves: Rust/C++ systems programming5 lessons · ~3h
// lessons
- 01
What a Lifetime Actually Says
Read 'a as a relationship between arguments, not a duration.
- 02
Elision Rules
Say which signatures need no annotation, and why yours does.
- 03
Multiple Lifetimes
Annotate a function whose output borrows from only one of two inputs.
- 04
Structs That Hold References
Build a zero-copy parser view over a buffer you do not own.
- 05
'static: Two Different Meanings
Distinguish a &'static str from a T: 'static bound — they are not the same claim.
Every exercise compiles and runs in the Forge sandbox — standard library only, no external crates.
