Crates.io | immutable-avl |
lib.rs | immutable-avl |
version | 1.0.0 |
source | src |
created_at | 2022-03-16 15:23:44.028035 |
updated_at | 2022-03-16 15:23:44.028035 |
description | An Immutable map and set implement for rust based on an AVL tree |
homepage | https://github.com/yunwei37/immutable-map-rs |
repository | https://github.com/yunwei37/immutable-map-rs |
max_upload_size | |
id | 551236 |
size | 14,569 |
This is an immutable (functional) set or map implementation based on an immutable AVL tree, purely safe rust.
The time and space complexity of add or remove operations is log(N)
in the size of the original set.
This little project was inspired by using the ImmutableMap in LLVM/Clang static analyzer.
let set = ImmutableSet::new();
let new_set = set.insert(1);
let map = ImmutableMap::new();
let new_map = new_map.insert(1, "abc");
let new_map = new_map.delete(1, "abc");
let size = new_map.size();
let data = new_map.get_val_as_ref(1);