Cell — Copy-based interior mutability. RefCell — runtime borrow checking.
Cell:
RefCell:
1use std::cell::{Cell, RefCell};23let c = Cell::new(5);4c.set(10); // No borrow needed56let r = RefCell::new(vec![1, 2, 3]);7r.borrow_mut().push(4); // Mutable borrow
Key: Cell for simple Copy types, RefCell for complex types.