Macro okapi::map[][src]

macro_rules! map {
    ($($key : expr => $val : expr), * $(,) *) => { ... };
}
Expand description

Macro to crate an okapi::Map with a number of key-value pairs in it.

Examples

use okapi::Map;
use okapi::map;

let my_map = map!{
    "user:read".to_owned() => "Ability to read user data".to_owned(),
    "user:write".to_owned() => "Ability to write user data".to_owned(),
};

let mut control = Map::new();
control.insert("user:read".to_owned(),"Ability to read user data".to_owned());
control.insert("user:write".to_owned(),"Ability to write user data".to_owned());

assert_eq!(my_map, control);