Ownership is a distinct feature of Rust (Programming Language) that governs how the language manages memory. It is based on a set of rules checked at compile time by the Borrow Checker. The key rules are:
- Each value in Rust has a variable that’s called its owner.
- There can only be one owner at a time.
- When the owner goes out of scope, the value will be dropped.
This system allows Rust to make memory safety guarantees without needing a garbage collector.
