[][src]Macro bidir_map::bidir_map

macro_rules! bidir_map {
    (@single $($x:tt)*) => { ... };
    (@count $($rest:expr),*) => { ... };
    ($($key:expr => $value:expr,)+) => { ... };
    ($($key:expr => $value:expr),*) => { ... };
}

Create a BidirMap from a set of K/V-K/V pairs.

Examples

#[macro_use]
extern crate bidir_map;
let map = bidir_map!(
    "a" => 1,
    "b" => 2,
);

assert_eq!(map.get_by_first(&"a"), Some(&1));
assert_eq!(map.get_by_second(&2),  Some(&"b"));
assert_eq!(map.get_by_first(&"c"), None);