3 releases (breaking)
0.3.0 | Feb 19, 2023 |
---|---|
0.2.0 | Feb 19, 2023 |
0.1.0 | Feb 16, 2023 |
#1941 in Data structures
70 downloads per month
24KB
563 lines
a hash table that shares one value across multiple keys.
lib.rs
:
Provides [MultiKeyMap], an associative array that can share one value
across multiple keys without Rc
, and provides mutable access
that will never panic at runtime, unlike RefCell
.
use multi_key_map::MultiKeyMap;
let mut map: MultiKeyMap<i32, String> = MultiKeyMap::from([
(vec![1, 2, 3], "foo".into()),
(vec![4, 5], "bar".into()),
]);
map.insert_many(vec![6, 7], "quux".into());
map.alias(&7, 8);
assert_eq!(map.get(&8), Some(&String::from("quux")));