Easy persistent data structures in Rust
Summary:
- A persistent data structure can easily keep track of previous versions of itself with little overhead.
- A regular data structure can be converted into a persistent one by replacing instances of
Box
withRc
, and replacing mutable dereferences withRc::make_mut
. - The resulting structure is both more performant and uses less memory if you plan on performing lots of clones.