Skip to main content

object

Macro object 

Source
macro_rules! object {
    ({ $( $k:tt : $v:tt ),* $(,)? }) => { ... };
    ($($k:expr => $v:tt),* $(,)?) => { ... };
    ($($k:tt : $v:tt),* $(,)?) => { ... };
}
Expand description

Constructs an Aurora Value::Object (HashMap) from key-value pairs.

Supports both JSON-style { "key": value } and arrow-style { "key" => value } syntax.

ยงExamples

let user = object!({
    "id": "u1",
    "name": "Alice",
    "active": true
});