Skip to main content

Module reader

Module reader 

Source
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.

Structs§

TlvReader
A streaming TLV decoder over a borrowed byte slice.

Enums§

ContainerKind
Which kind of TLV container a ContainerStart announces.
Element
One step of the streaming reader.

Constants§

DEFAULT_ELEMENT_BUDGET
Default ceiling on the total number of Value elements a single TlvReader::read_value call 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.