Ownership



This content originally appeared on DEV Community and was authored by xavier2code

Ownership is Rust’s most unique feature and has deep implications for the rest of the language. it enables Rust to make memory safety guarantees without needing a garbage collector.

Ownership is a set of rules that govern how a Rust program manages memory.

  • Each value in Rust has an owner.
  • There can only be one owner at a time.
  • When the owner goes out of scope, the value will be dropped.


This content originally appeared on DEV Community and was authored by xavier2code