Skip to main content

hashmap

Macro hashmap 

Source
macro_rules! hashmap {
    {} => { ... };
    { $($key:expr => $value:expr),* $(,)? } => { ... };
}
Expand description

Create a HashMap with initial values.

ยงExample

use sakurai::{hashmap, HashMap};

let empty: HashMap<i32, &str, 16> = hashmap! {};

let with_values: HashMap<i32, &str, 16> = hashmap! {
    1 => "one",
    2 => "two",
    3 => "three"
};