Skip to main content

Ownership & Memory

The foundation of Rust's safety guarantees. No GC, no dangling pointers, no data races — enforced at compile time.

Ownership ModelThe three rules: one owner, no aliases, drop on scope exit
Borrowing & ReferencesShared (&T) and exclusive (&mut T) borrows
LifetimesEnsuring references don't outlive the data they point to