1/6

RefCell<T> moves the borrow check from compile time to runtime. The rule is unchanged — many shared borrows or one exclusive borrow — but it is now counted at runtime, and violating it panics instead of failing to compile.

let cell = RefCell::new(Vec::new());
cell.borrow_mut().push("started");    // &mut, released at end of statement
println!("{}", cell.borrow().len());  // & — fine, the mut borrow is gone

This is interior mutability: mutating through a &self. It is what lets Rc<RefCell<T>> give several owners the ability to write.