pub fn display<'b>(cbor: &'b [u8]) -> impl Display + 'bExpand description
Display the given CBOR bytes in diagnostic notation.
Requires features "alloc" and "half".
Quick syntax summary:
- Maps are enclosed in curly braces:
{and}. - Arrays are enclosed in brackets:
[and]. - Indefinite maps start with
{_instead of{. - Indefinite arrays start with
[_instead of[. - Bytes are hex encoded and enclosed in
h'and'. - Strings are enclosed in double quotes.
- Numbers and booleans are displayed as in Rust but floats are always shown in scientific notation (this differs slightly from the RFC format).
- Indefinite bytes are enclosed in
(_and)except for the empty sequence which is shown as''_. - Indefinite strings are enclosed in
(_and)except for the empty sequence which is shown as""_. - Tagged values are enclosed in
t(and)wheretis the numeric tag value. - Simple values are shown as
simple(n)wherenis the numeric simple value. - Undefined and null are shown as
undefinedandnull.
No error is produced should decoding fail, the error message becomes part of the display.