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.
- Bindings, moves, and copies
- Borrowing and reborrowing
- Reference binding reassignment
- Returned references
- Optional and fallible references
- Borrowed matching
- Deterministic destruction
Types define which values can be stored together. Iteration and resource scopes apply these same ownership rules to their hidden owners.