#[non_exhaustive]pub enum Value {
Bool(bool),
Uint(u64),
Int(i64),
Float(f32),
Double(f64),
Utf8(String),
Bytes(Vec<u8>),
Structure(Vec<(Tag, Value)>),
Array(Vec<Value>),
List(Vec<(Tag, Value)>),
Null,
}Expand description
A decoded Matter TLV value, collapsed across wire widths.
Integer widths and float widths are erased from the public type — the
encoder chooses the minimal wire width per the spec, and the decoder
produces the same Rust type regardless of the width the bytes used. If
you need exact-byte round-trip for non-minimal inputs, use the reader’s
span APIs (crate::TlvReader::element_span /
crate::TlvReader::skip_container_span + crate::TlvReader::span_bytes),
which expose an element’s raw bytes for width-preserving re-emission.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bool(bool)
A boolean.
Uint(u64)
An unsigned integer, encoded on the wire in 1, 2, 4, or 8 bytes (minimal width).
Int(i64)
A signed integer, encoded on the wire in 1, 2, 4, or 8 bytes (minimal width).
Float(f32)
A 4-byte IEEE 754 single-precision float.
Double(f64)
An 8-byte IEEE 754 double-precision float.
Utf8(String)
A UTF-8 string. The wire format is a 1/2/4/8-byte little-endian
length field (writer picks the minimal width) followed by the
raw UTF-8 bytes. The reader rejects invalid UTF-8 with
crate::Error::InvalidUtf8.
Bytes(Vec<u8>)
An octet string. The wire format is a 1/2/4/8-byte little-endian length field (writer picks the minimal width) followed by the raw bytes.
Structure(Vec<(Tag, Value)>)
A structure. Each member carries its own tag; members are typically context-tagged but the spec permits any non-anonymous form.
Array(Vec<Value>)
An array. Elements share a single type; the spec requires every element to carry an anonymous tag, which the reader enforces and the writer always emits.
List(Vec<(Tag, Value)>)
A list. Members may carry any tag form (including anonymous), and member types are not required to be uniform.
Null
The TLV null value (element type 0x14).