You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation of the std::cell crate,
Cell types come in two flavors: Cell<T> and RefCell<T>. Cell<T> implements interior mutability by moving values in and out of the Cell<T>. To use references instead of values, one must use the RefCell<T> type, acquiring a write lock before mutating.
So I think the choice of Cell vs RefCell depends on whether you want plain & references to the contained data or not.
The infographic suggests that Cell can only be used with Copy types. But you can move anything into a Cell. See the replace method.
The text was updated successfully, but these errors were encountered: