3 releases

0.1.2 Oct 7, 2023
0.1.1 Jun 10, 2023
0.1.0 May 11, 2023

#687 in Asynchronous

Download history 6/week @ 2023-08-02 12/week @ 2023-08-09 12/week @ 2023-08-16 6/week @ 2023-08-23 6/week @ 2023-08-30 15/week @ 2023-09-06 7/week @ 2023-09-13 6/week @ 2023-09-20 11/week @ 2023-09-27 37/week @ 2023-10-04 11/week @ 2023-10-11 11/week @ 2023-10-18 15/week @ 2023-10-25 6/week @ 2023-11-01 10/week @ 2023-11-08 21/week @ 2023-11-15

52 downloads per month
Used in 2 crates

Apache-2.0

255KB
2.5K SLoC

baildon

A very simple B+Tree library.

Features:

  • Generic B+Tree
  • Asynchronous (uses tokio)
  • Write Ahead Log
  • serde based storage format (bincode)
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");

Crates.io

API Docs

Installation

[dependencies]
baildon = "0.1"

Examples

There are a few simple examples to show how to use the library:

cargo run --example hello
cargo run --example streaming

Benchmarks

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

License

Apache 2.0 licensed. See LICENSE for details.

Dependencies

~10–18MB
~222K SLoC