Series 11: Smart Pointers and Interior Mutability
Welcome to Series 11. In this series, we will explore smart pointers, a set of data structures that act like pointers but also have additional metadata and capabilities. We will also delve into the interior mutability pattern, which allows you to mutate data even when there are immutable references to it.
Articles
- 81.
Box<T>
for Allocating Data on the Heap - 82.
Deref
Trait for Treating Smart Pointers like Regular References - 83.
Rc<T>
, the Reference Counted Smart Pointer - 84.
RefCell<T>
and the Interior Mutability Pattern - 85. Combining
Rc<T>
andRefCell<T>
for Multiple Owners of Mutable Data - 86. Reference Cycles and How to Prevent Them
- 87.
Weak<T>
to Create Non-Owning References - 88. Project: Building a Simple Linked List with Smart Pointers