Smart Pointers in Rust
An exploration of smart pointers in Rust, focusing on the core concepts of the Deref and Drop traits that give them their power.
An exploration of smart pointers in Rust, focusing on the core concepts of the Deref and Drop traits that give them their power.
Understand the interior mutability pattern in Rust using RefCell<T> and Cell<T> to mutate data even with immutable references.
Learn how to use Rc<T> and Arc<T> for multiple ownership scenarios in Rust through reference counting.
An explanation of how reference cycles can cause memory leaks in Rust when using Rc<T> and how to prevent them with Weak<T>.
An introduction to Box<T>, Rust's smart pointer for heap allocation, with examples for recursive types and large data transfer.