Crate rc_box

Source
Expand description

Known unique versions of Rc and Arc. This allows them to be used for mutable ownership.

The main reason to use RcBox or ArcBox is for types that will be reference counted, but need some “fixing up” done after being allocated behind the reference counted pointer. With the standard library types, you would use get_mut and have to handle the impossible case where the value was shared. With the known unique versions, you have DerefMut, so it’s as simple as mutating behind a Box.

Structs§