Glossary coding Term Page
RefCell<T>
A runtime borrow-checking type for interior mutability
Core Idea
[[refcell|RefCell<T>]] is the Rust type that enforces borrowing rules at runtime instead of compile time. Even when you hold only an immutable outer reference, the inner value can still be mutated, but any rule violation triggers a panic.
Why It Matters Here
Mathbong uses RefCell for the Rc<RefCell<T>> pattern, GUI-like trees, graph structures, and interior mutability in practice. It shows what flexibility you gain when the compiler no longer catches every borrow conflict up front.