Skip to main content

value

Macro value 

Source
macro_rules! value {
    (null) => { ... };
    (true) => { ... };
    (false) => { ... };
    ([]) => { ... };
    ([ $( $tt:tt )+ ]) => { ... };
    ({}) => { ... };
    ({ $( $k:tt : $v:tt ),* $(,)? }) => { ... };
    ($val:expr) => { ... };
}
Expand description

Constructs an Aurora Value from Rust literals.

This macro provides a JSON-like syntax for creating strongly-typed Aurora values without the overhead of JSON serialization. It is used internally by object! and array!, but can also be used directly.

ยงExamples

let v_null = value!(null);
let v_bool = value!(true);
let v_num = value!(42);
let v_str = value!("hello");