January 2019
Beginner to intermediate
554 pages
13h 31m
English
As we saw previously, Rust protects us at compile time from the pointer aliasing problem by allowing only a single mutable reference at any given scope. However, there are cases where it becomes too restrictive, making code that we know is safe not pass the compiler because of the strict borrow checking. For these situations, one of the solutions is to move the borrow checking from compile time to runtime, which is achieved with interior mutability. Before we talk about the types that enable interior mutability, we need to understand the concept of interior mutability and inherited mutability:
Read now
Unlock full access