#router #tree #path

no-std keetree

A lightweight and fast router with no_std support

1 unstable release

0.0.1 Dec 21, 2023

#216 in #router

Custom license

9KB
157 lines

keetree (WIP)

Version License

A lightweight and fast router with no_std support. The main library comes in at 182 lines only.

use keetree::Node;

fn main() {
    let router = Node::default();
    node.insert("a/b/c".split('/'), 1)
    assert_eq!(node.match("a/b/c".split('/')).unwrap(), 1)
}

Notable Behavior

Inserts on the same route with different values will update it.

Benchmarks

Only twice as slow as matchit which is the fastest rust router (that I know of). Not bad for something that's completely unoptimized. You can find matchit's benchmarks here.

Library Match
matchit 190.58 ns
keetree 490.32 ns

Dependencies

~3.5–5MB
~77K SLoC