[−][src]Macro mynewt::parse
macro_rules! parse { (@$enc:ident @object $object:ident () () ()) => { ... }; (@none @object $object:ident [$($key:tt)+] ($value:expr) , $($rest:tt)*) => { ... }; (@$enc:ident @object $object:ident [$($key:tt)+] ($value:expr) , $($rest:tt)*) => { ... }; (@$enc:ident @object $object:ident [$($key:tt)+] ($value:expr) $unexpected:tt $($rest:tt)*) => { ... }; (@$enc:ident @object $object:ident [$($key:tt)+] ($value:expr)) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: null $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: true $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: false $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: [$($array:tt)*] $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: {$($map:tt)*} $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: $value:expr , $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (: $value:expr) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)+) (:) $copy:tt) => { ... }; (@none @object $object:ident ($($key:tt)+) () $copy:tt) => { ... }; (@json @object $object:ident ($($key:tt)+) () $copy:tt) => { ... }; (@cbor @object $object:ident ($($key:tt)+) () $copy:tt) => { ... }; (@cbormin @object $object:ident ($($key:tt)+) () $copy:tt) => { ... }; (@$enc:ident @object $object:ident () (: $($rest:tt)*) ($colon:tt $($copy:tt)*)) => { ... }; (@none @object $object:ident ($($key:tt)*) (, $($rest:tt)*) ($comma:tt $($copy:tt)*)) => { ... }; (@json @object $object:ident ($($key:tt)*) (, $($rest:tt)*) ($comma:tt $($copy:tt)*)) => { ... }; (@cbor @object $object:ident ($($key:tt)*) (, $($rest:tt)*) ($comma:tt $($copy:tt)*)) => { ... }; (@cbormin @object $object:ident ($($key:tt)*) (, $($rest:tt)*) ($comma:tt $($copy:tt)*)) => { ... }; (@$enc:ident @object $object:ident () (($key:expr) : $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @object $object:ident ($($key:tt)*) ($tt:tt $($rest:tt)*) $copy:tt) => { ... }; (@$enc:ident @array [$($elems:expr,)*]) => { ... }; (@$enc:ident @array [$($elems:expr),*]) => { ... }; (@$enc:ident @array [$($elems:expr,)*] null $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] true $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] false $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] [$($array:tt)*] $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] {$($map:tt)*} $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] $next:expr, $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr,)*] $last:expr) => { ... }; (@$enc:ident @array [$($elems:expr),*] , $($rest:tt)*) => { ... }; (@$enc:ident @array [$($elems:expr),*] $unexpected:tt $($rest:tt)*) => { ... }; (@$enc:ident null) => { ... }; (@$enc:ident true) => { ... }; (@$enc:ident false) => { ... }; (@$enc:ident []) => { ... }; (@$enc:ident [ $($tt:tt)+ ]) => { ... }; (@$enc:ident {}) => { ... }; (@none { $($tt:tt)+ }) => { ... }; (@json { $($tt:tt)+ }) => { ... }; (@cbor { $($tt:tt)+ }) => { ... }; (@cbormin { $($tt:tt)+ }) => { ... }; (@$enc:ident $other:expr) => { ... }; }
Parse the JSON code in the parameter and compose the CoAP payload. This macro takes these parameters:
- Encoding:
@json
,@cbor
or@none
- State: Current parsing state (
@object
,@array
or omitted) - Context: JSON or CBOR parsing context (
JsonContext
orCborContext
) - Remaining tokens to be parsed
- Remaining tokens again, for error display