Skip to content
Efficiently-updatable double-array trie in Rust (ported from cedar)
Rust C++
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Add Clone and Debug implementation Jul 13, 2019
.editorconfig Add .editorconfig Jul 9, 2019
.gitignore Add .vscode into .gitignore Jul 10, 2019
.travis.yml Fix reduced-trie feature Jul 12, 2019
Cargo.lock Commit the Cargo.lock changes Jul 14, 2019
Cargo.toml Bump minor version Jul 13, 2019
LICENSE Add LICENSE file Jul 9, 2019 Update README Jul 13, 2019
rustfmt.toml Add rustfmt.toml Jul 9, 2019


Efficiently-updatable double-array trie in Rust (ported from cedar). This library is tested with reasonably enough of randomized tests, but it is considered as beta since it is not yet tested in high-pressured production environment. Please let me know if you have good use cases to prove its stability.

Build Status codecov


Add it to your Cargo.toml:

cedarwood = "0.4"

then you are good to go. If you are using Rust 2015 you have to extern crate cedarwood to your crate root as well.


let dict = vec![
let key_values: Vec<(&str, i32)> = dict.into_iter().enumerate().map(|(k, s)| (s, k as i32)).collect();
let mut cedar = Cedar::new();;

let result: Vec<i32> = cedar.common_prefix_search("abcdefg").iter().map(|x| x.0).collect();
assert_eq!(vec![0, 1, 2], result);

let result: Vec<i32> = cedar
    .map(|x| x.0)
assert_eq!(vec![6, 7, 8], result);

let result: Vec<i32> = cedar
    .map(|x| x.0)
assert_eq!(vec![9, 10, 11, 12], result);

let result: Vec<i32> = cedar
    .map(|x| x.0)
assert_eq!(vec![4], result);

To run benchmark tests

cargo bench 


This work is released under the BSD-2 license, following the original license of C++ cedar. A copy of the license is provided in the LICENSE file.


You can’t perform that action at this time.