Whistlin'Oak

Repository Build Status Documentation

Annotated even-arity trees backed by mmaps.

Usage

toml whistlinoak = "0.1"

Example

```rust use tempfile::NamedTempFile; use whistlinoak::{Annotation, Tree};

let file = NamedTempFile::new().unwrap(); let path = file.intotemppath();

struct Cardinality(usize);

impl Annotation for Cardinality { fn compute(leaf: &T) -> Self { Cardinality(1) }

fn combine<'a>(annotations: impl Iterator<Item=&'a Self>) -> Self
where
    Self: 'a
{
    Self(annotations.fold(0, |curr, c| curr + c.0))
}

}

let mut tree = Tree::::new(path).unwrap();

let n_leaves = 1000;

for i in 0..n_leaves { tree.push(i).unwrap(); }

asserteq!(tree.len(), nleaves); asserteq!(tree.root().0, nleaves); ```