macro_rules! value {
(@array [$($elems:expr,)*]) => { ... };
(@array [$($elems:expr),*]) => { ... };
(@array [$($elems:expr,)*] null $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] true $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] false $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] [$($array:tt)*] $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] {$($map:tt)*} $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] $next:expr, $($rest:tt)*) => { ... };
(@array [$($elems:expr,)*] $last:expr) => { ... };
(@array [$($elems:expr),*] , $($rest:tt)*) => { ... };
(@array [$($elems:expr),*] $unexpected:tt $($rest:tt)*) => { ... };
(@object $object:ident () () ()) => { ... };
(@object $object:ident [$($key:tt)+] ($value:expr) , $($rest:tt)*) => { ... };
(@object $object:ident [$($key:tt)+] ($value:expr) $unexpected:tt $($rest:tt)*) => { ... };
(@object $object:ident [$($key:tt)+] ($value:expr)) => { ... };
(@object $object:ident ($($key:tt)+) (: null $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: true $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: false $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: [$($array:tt)*] $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: {$($map:tt)*} $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: $value:expr , $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (: $value:expr) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) (:) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)+) () $copy:tt) => { ... };
(@object $object:ident () (: $($rest:tt)*) ($colon:tt $($copy:tt)*)) => { ... };
(@object $object:ident ($($key:tt)*) (, $($rest:tt)*) ($comma:tt $($copy:tt)*)) => { ... };
(@object $object:ident () (($key:expr) : $($rest:tt)*) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)*) (: $($unexpected:tt)+) $copy:tt) => { ... };
(@object $object:ident ($($key:tt)*) ($tt:tt $($rest:tt)*) $copy:tt) => { ... };
(null) => { ... };
(true) => { ... };
(false) => { ... };
([]) => { ... };
([ $($tt:tt)+ ]) => { ... };
({}) => { ... };
({ $($tt:tt)+ }) => { ... };
($other:expr) => { ... };
}Expand description
This macro provides a natural way to make a types::Value while making it readable Small sized structures such as i32 will be converted to their bigger supported structure sizes, i64. For integers the type used is i64 For floats, f64 To declare a types::Value::Buffer use a byte-string, such as: ```rust b“content goes here!“
Here's an example on how you could use this macro:
```rust
let my_data = value!(["sample text", {
"is_edible": false,
"optional_data": null,
"position": [1.0, 15.0],
"id": 3,
}, b"scary binary data!"]);