value

Macro value 

Source
macro_rules! value {
    ($($tt:tt)*) => { ... };
}
Expand description

Construct a scale_value::Value

Supports unnamed and named composites and variants:

use scale_value::value;

let val = value!({
    name: "localhost",
    address: V4(127, 0, 0, 1),
    payload: {
        bytes: (255, 3, 4, 9),
        method: ("Post", 3000),
    },
});

Values can be nested in each other:

use scale_value::value;

let data_value = value!((1, v1(1, 2), 3));
let val = value!(POST { data: data_value });

Trailing commas are optional.