11 releases (breaking)

0.9.0 Oct 25, 2023
0.7.0 Jun 28, 2023
0.6.1 Nov 14, 2022
0.5.1 Apr 29, 2022
0.3.0 Mar 29, 2022

#1075 in Data structures

Download history 1536/week @ 2023-12-14 932/week @ 2023-12-21 1352/week @ 2023-12-28 2372/week @ 2024-01-04 3296/week @ 2024-01-11 3724/week @ 2024-01-18 3825/week @ 2024-01-25 3106/week @ 2024-02-01 2980/week @ 2024-02-08 4526/week @ 2024-02-15 3878/week @ 2024-02-22 4509/week @ 2024-02-29 2887/week @ 2024-03-07 5858/week @ 2024-03-14 4313/week @ 2024-03-21 2516/week @ 2024-03-28

16,409 downloads per month
Used in 79 crates (40 directly)

MIT/Apache

115KB
2.5K SLoC

HAMT crate for use as rust IPLD data structure

Data structure reference

Implementation based off the work @dignifiedquire started here. This implementation matched the rust HashMap interface very closely, but came at the cost of saving excess values to the database and requiring unsafe code to update the cache from the underlying store as well as discarding any errors that came in any operations. The function signatures that exist are based on this, but refactored to match the spec more closely and match the necessary implementation.

The Hamt is a data structure that mimmics a HashMap which has the features of being sharded, persisted, and indexable by a Cid. The Hamt supports a variable bit width to adjust the amount of possible pointers that can exist at each height of the tree. Hamt can be modified at any point, but the underlying values are only persisted to the store when the flush is called.

Dependencies

~4MB
~83K SLoC