diff --git a/rust/radixbuf/Cargo.toml b/rust/radixbuf/Cargo.toml new file mode 100644 --- /dev/null +++ b/rust/radixbuf/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "radixbuf" +version = "0.1.0" + +[dependencies] +error-chain = "0.11" +vlqencoding = { path = "../vlqencoding" } + +[dev-dependencies] +quickcheck = "0.4" +rand = "0.3" +rustc-test = "0.2" diff --git a/rust/radixbuf/README.md b/rust/radixbuf/README.md new file mode 100644 --- /dev/null +++ b/rust/radixbuf/README.md @@ -0,0 +1,10 @@ +# radixbuf + +Radix tree based on plain buffers. + +There are 2 plain buffers: + + - Radix buffer: One or more radix trees mapping keys to their IDs. Read and write by the library. + - Key buffer: The source of truth of full keys. Read by the library, write by the application. + +An ID of a key could be an offset, or other meaningful numbers understood by the function reading a key. diff --git a/rust/radixbuf/src/errors.rs b/rust/radixbuf/src/errors.rs new file mode 100644 --- /dev/null +++ b/rust/radixbuf/src/errors.rs @@ -0,0 +1,13 @@ +// Copyright 2017 Facebook, Inc. +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +error_chain! { + foreign_links { + Io(::std::io::Error); + } + + errors { + } +} diff --git a/rust/radixbuf/src/lib.rs b/rust/radixbuf/src/lib.rs new file mode 100644 --- /dev/null +++ b/rust/radixbuf/src/lib.rs @@ -0,0 +1,21 @@ +// Copyright 2017 Facebook, Inc. +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +#[macro_use] +extern crate error_chain; + +#[cfg(test)] +#[macro_use] +extern crate quickcheck; + +#[cfg(test)] +extern crate rand; + +#[cfg(test)] +extern crate test; + +extern crate vlqencoding; + +pub mod errors;