Lots of resources online mention how Rc<RefCell> can be used to combine multiple ownership with interior mutability. This left me wondering: why is RefCell the go-to here, rather than Cell? I'm assuming this has practical limitations, but from a purely technical perspective it can be done, e.g.:
let cell = Cell::new(5);
let rc1 = Rc::new(cell);
let rc2 = rc1.clone();
rc1.set(7);
rc2.set(9);
I imagine Cell, with its more numerous restrictions, makes it less suitable for practical applications. E.g. calling any &mut self method on the contained value. This seems particularly tricky to deal with if the contained value does not implement Copy. But this is conjecture on my part. Is there a clear reasoning for this?