A key,value store that works on anything.
This works using a binary search tree. In the first version, it's a very naive algorithm, but it will probably be updated to be a red-black tree or something else.
treemap
find
- Find a value based on the keyinsert
- Insert a value into the maptraverse
- Visit all pairs in the map in order.treemap
- Create a treemaptreemap
type treemap<K, V> = @mut tree_edge<K, V>
find
fn find<K: copy, V: copy>(m: &const tree_edge<K, V>, k: K) -> option<V>
Find a value based on the key
insert
fn insert<K: copy, V: copy>(m: &mut tree_edge<K, V>, k: K, v: V)
Insert a value into the map
traverse
fn traverse<K, V: copy>(m: &const tree_edge<K, V>, f: fn(K, V))
Visit all pairs in the map in order.
treemap
fn treemap<K, V>() -> treemap<K, V>
Create a treemap