Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ownership, borrowing, and lifetimes

An owner controls a value’s lifetime. Copyable values can have independent owners; affine values transfer their ownership when moved. References lend access without taking ownership. Access permissions end at a loan’s last use; owned resources follow the specified destruction scopes.

Types define which values can be stored together. Iteration and resource scopes apply these same ownership rules to their hidden owners.