| Crates.io | mbimap |
| lib.rs | mbimap |
| version | 0.0.4 |
| created_at | 2025-07-14 15:48:21.062579+00 |
| updated_at | 2025-07-15 15:23:55.830567+00 |
| description | Pooled bijective maps in Rust |
| homepage | https://github.com/fawdlstty/mbimap |
| repository | https://github.com/fawdlstty/mbimap |
| max_upload_size | |
| id | 1751929 |
| size | 7,069 |
Similar to bimap, but it provides a pooled dataset, facilitating the storage of multiple mappings.
let mut map = MbiMap::new();
map.insert(1, "a");
map.insert_by_left(2, vec!["a", "b", "c"]);
map.insert_by_right(vec![3, 4], "b");
println!("{:?}", map.get_by_left(&2)); // [a, b, c]
println!("{:?}", map.get_by_right(&"b")); // [2, 3, 4]
map.remove_all_by_left(&1);
map.remove_all_by_right(&"c");
println!("{map:?}"); // 2->[a, b], 3->[b], 4->[b]