13 releases (breaking)

new 0.10.1 Nov 8, 2024
0.9.0 Oct 25, 2023
0.7.0 Jun 28, 2023
0.6.1 Nov 14, 2022
0.3.0 Mar 29, 2022

#327 in Database interfaces

Download history 3076/week @ 2024-07-19 1974/week @ 2024-07-26 3625/week @ 2024-08-02 2451/week @ 2024-08-09 3190/week @ 2024-08-16 2567/week @ 2024-08-23 2767/week @ 2024-08-30 3443/week @ 2024-09-06 3222/week @ 2024-09-13 4305/week @ 2024-09-20 1885/week @ 2024-09-27 2472/week @ 2024-10-04 2559/week @ 2024-10-11 1558/week @ 2024-10-18 1393/week @ 2024-10-25 999/week @ 2024-11-01

6,805 downloads per month
Used in 80 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
~85K SLoC