Type Alias fvm_ipld_hamt::Hamt

source ·
pub type Hamt<BS, V, K = BytesKey, H = Sha256> = HamtImpl<BS, V, K, H, V3>;
Expand description

Implementation of the HAMT data structure for IPLD.

§Examples

use fvm_ipld_hamt::Hamt;

let store = fvm_ipld_blockstore::MemoryBlockstore::default();

let mut map: Hamt<_, _, usize> = Hamt::new(store);
map.set(1, "a".to_string()).unwrap();
assert_eq!(map.get(&1).unwrap(), Some(&"a".to_string()));
assert_eq!(map.delete(&1).unwrap(), Some((1, "a".to_string())));
assert_eq!(map.get::<_>(&1).unwrap(), None);
let cid = map.flush().unwrap();

Aliased Type§

struct Hamt<BS, V, K = BytesKey, H = Sha256> { /* private fields */ }