vdict

Macro vdict 

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

Constructs Dictionary literals, close to Godot’s own syntax.

Any value can be used as a key, but to use an expression you need to surround it in () or {}.

§Example

use godot::builtin::{vdict, Variant};

let key = "my_key";
let d = vdict! {
    "key1": 10,
    "another": Variant::nil(),
    key: true,
    (1 + 2): "final",
};

§See also

For arrays, similar macros array! and varray! exist.