Struct cbor_tools::format::Element [−][src]
pub struct Element { /* fields omitted */ }
Expand description
A unit of CBOR-encoded data
Each Element
contains:
- A major number, indicating the type of data.
- An “additional information” field.
- A Zero-to-eight byte immediate value (containing a numeric value or length).
- An optional sequence of payload bytes.
See RFC 7049 for details.
Some CborType
values will require multiple Element
s to encode.
Implementations
Create a new Element, with no payload buffer.
Create a new Element, with no payload buffer or immediate data.
Extract a length value from the Element
.
In many elements, the adn_info
and imm
fields encode a length parameter.
This function attempts to extract that value.
If the adn_info is not a value between 0 and 27, it will return an error.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Element
impl UnwindSafe for Element
Blanket Implementations
Mutably borrows from an owned value. Read more