8
Ownership
Ownership is part of the memory strategy in Rust that encourages safe memory management. For developers, memory management has been a consistent reason of application instability. Memory violations, freeing the same memory twice, race conditions, and various security vulnerabilities are some of the problems that can occur. Worst of all, these problems may be inconsistent and often occur intermittently. Developers sometimes spend long hours, if not days, debugging memory issues. Ownership addresses many of these issues, making the resulting code more robust and reliable, giving developers confidence in their own code.
The term “borrow checker” appears frequently in this chapter. In Rust, ownership sets the rules for memory safeness. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access