#hash-map #delta #collection #operations #commit #delta-hash-map

delta-collections

Data structures with revertable operations called deltas

8 releases

0.1.5 Aug 16, 2024
0.1.4 Aug 16, 2024
0.0.2 Aug 15, 2024

#458 in Data structures

Download history 536/week @ 2024-08-12 46/week @ 2024-08-19 2/week @ 2024-08-26

584 downloads per month

MIT license

46KB
715 lines

Delta Collections

Data structures with delta entries that enables quick revert of the recent changes. Implementation-wise, the data structures keeps a delta structure that records the additional changes on the base structure. Take the HashMap for example, the user can call DeltaHashMap::commit to merge the additional changes into the base map. However, if the user is unsatisfied with the result of the specific layer of operation, the changes that happens after the layer can be discarded on demand by calling DeltaHashMap::revert.

Currently, only hashmaps are supported. Common operations and iterators on the data structure are also supported.

See DeltaHashMap::commit, DeltaHashMap::revert and DeltaHashMap::cocommit for more information.


lib.rs:

Data structures with delta entries that enables quick unstage of the recent changes. Implementation-wise, the data structures keeps a delta structure that records the additional changes on the base structure. Take the HashMap for example, the user can call DeltaHashMap::commit to merge the additional changes into the base map. However, if the user is unsatisfied with the result of the specific layer of operation, the changes that happens after the layer can be discarded on demand by calling DeltaHashMap::unstage.

See DeltaHashMap::commit, DeltaHashMap::unstage and DeltaHashMap::cocommit for more information.

Dependencies

~0.4–1MB
~22K SLoC