March 2018
Intermediate to advanced
272 pages
7h 4m
English
To ensure memory and thread safety, Rust's borrow checker has three simple rules. They are enforced all through the code except in unsafe scopes. Here they are:
These three rules seem simple enough, but they have a great implication on how we code. The compiler can know beforehand when an owner goes out of scope, so it will always know when to drop/destruct a binding/variable. This means that you can write your code without having to think about where you create variables, where you call destructors, or whether you have already called a destructor or you are calling it twice. ...
Read now
Unlock full access