Crates.io | baildon |
lib.rs | baildon |
version | 0.1.2 |
source | src |
created_at | 2023-05-11 12:36:32.915813 |
updated_at | 2023-10-07 10:16:12.012759 |
description | B+Tree library |
homepage | https://github.com/garypen/baildon |
repository | https://github.com/garypen/baildon |
max_upload_size | |
id | 862048 |
size | 736,116 |
A very simple B+Tree library.
Features:
use baildon::tree::Baildon;
use baildon::tree::Direction;
// Create a B+Tree with usize for key and value, branching factor 7
let tree = Baildon::<usize, usize>::try_new("retrieve_keys_from_empty_tree.db", 7)
.await
.expect("creates tree file");
// Collect all our keys
let keys = tree
.keys(Direction::Ascending)
.await
.collect::<Vec<usize>>()
.await;
// It should be empty, we didn't add any keys
assert!(keys.is_empty());
// Remove our B+Tree file, we aren't going to use it again
std::fs::remove_file("retrieve_keys_from_empty_tree.db").expect("cleanup");
[dependencies]
baildon = "0.1"
There are a few simple examples to show how to use the library:
cargo run --example hello
cargo run --example streaming
I've got some very simple benchmarks that I've used during development to look for regressions. I'll aim to improve these at some point.
cargo bench --bench baildon
Apache 2.0 licensed. See LICENSE for details.