bidir-map 0.3.2

Bidirectional map implementation for Rust

Crate bidir_map [] [src]

Bidirectional maps for Rust.

Examples

use bidir_map::BidirMap;

let mut map = BidirMap::new();
map.insert(1, "a");
assert_eq!(map.get_by_first(&1), Some(&"a"));
assert_eq!(map.get_by_first(&2), None);
assert_eq!(map.get_by_second(&"a"), Some(&1));
assert_eq!(map.get_by_second(&"b"), None);

Structs

BidirMap

A bidirectional map.

FirstColumn
Iter
IterMut
SecondColumn