15 releases (9 breaking)

new 0.10.3 Dec 4, 2024
0.10.2 Nov 20, 2024
0.10.0 Oct 31, 2024
0.9.0 Oct 25, 2023
0.3.0 Mar 29, 2022

#346 in Database interfaces

Download history 3326/week @ 2024-08-18 2427/week @ 2024-08-25 3238/week @ 2024-09-01 3341/week @ 2024-09-08 3461/week @ 2024-09-15 3608/week @ 2024-09-22 2087/week @ 2024-09-29 2379/week @ 2024-10-06 2405/week @ 2024-10-13 1390/week @ 2024-10-20 1515/week @ 2024-10-27 1447/week @ 2024-11-03 693/week @ 2024-11-10 1272/week @ 2024-11-17 1492/week @ 2024-11-24 1660/week @ 2024-12-01

5,196 downloads per month
Used in 81 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

~3–4.5MB
~83K SLoC