Expand description
Streaming TLV decoder.
TlvReader::next walks the input one element at a time. Scalars are
returned as Element::Scalar; containers emit a Element::ContainerStart
immediately followed by the children’s elements and then a matching
Element::ContainerEnd. Use TlvReader::read_value to materialise an
entire element tree in one call. TlvReader::next_ref is the zero-copy
sibling of TlvReader::next: it borrows string/bytes payloads straight
from the input instead of allocating, and is the decode core next itself
is implemented over.
Structs§
- Element
Span - Byte offsets of one element within a
TlvReader’s input, produced byTlvReader::element_span/TlvReader::skip_container_span. - TlvReader
- A streaming TLV decoder over a borrowed byte slice.
Enums§
- Container
Kind - Which kind of TLV container a
ContainerStartannounces. - Element
- One step of the streaming reader.
- Element
Ref - One step of the streaming reader, borrowing string/bytes payloads from
the input — the zero-copy sibling of
Element. Produced byTlvReader::next_ref; convert withElement::fromwhen ownership is needed.
Constants§
- DEFAULT_
ELEMENT_ BUDGET - Default ceiling on the total number of
Valueelements a singleTlvReader::read_valuecall may materialise. - MAX_
DEPTH - Maximum container nesting depth the reader accepts. The Matter spec recommends a 32-level limit to prevent stack blow-up on adversarial input.