Skip to content

Borrowing and Temporary Access

Temporary access to owned data can be granted without transferring ownership, enabling safe sharing while maintaining clear lifetime semantics - the borrower cannot outlive the owner.

Tension Addressed

Convenience vs. Control; Value vs. Reference Semantics

Recognizable As

References vs. owned values; "borrow checker" enforcement; immutable vs. mutable borrows; lifetime annotations; "value borrowed here" errors

Canonical Sources

Rust Book, Chapter on References and Borrowing (2015+); Clarke, Potter & Noble, "Ownership Types for Flexible Alias Protection" (1998)

Transfers To

Database transaction isolation levels, read-write locks, capability-based security, any temporary delegation of access

Borrowing solves the tension between ownership's determinism and the need for shared access. The key invariant: multiple readers OR single writer, never both. This pattern appears in database isolation, concurrent data structures, and anywhere temporary access must be safe.