Merkle Binary Indexed Tree (Merkle-BIT)
This tree structure is a binary merkle tree with branch compression via split indexes. See here for a basic explanation of its purpose.
Basic Usage
extern crate starling;
use starling::merkle_bit::MerkleBIT;
use std::path::PathBuf;
fn main() {
let path = PathBuf::new("some path");
let mbit = MerkleBIT<DatabaseType,
BranchType,
LeafType,
DataType,
NodeType,
HasherType,
HashResultType,
ValueType>::new(path, 8);
let key: Vec<u8> = vec![0x00u8, 0x81u8, 0xA3u8];
let value: ValueType = ValueType::new("Some value");
let root: Vec<u8> = mbit.insert(None, &[key.as_ref()], &[value.as_ref()])?;
let inserted_values: Vec<Option<ValueType>> = mbit.get(root.as_ref(), &[key.as_ref()])?;
mbit.remove(root.as_ref())?;
}