#[non_exhaustive]pub enum Value<'a> {
Signed(i64),
Unsigned(u64),
Bool(bool),
Float(f32),
Double(f64),
Utf8(&'a str),
Octets(&'a [u8]),
Null,
Container(ContainerKind),
EndOfContainer,
}Expand description
A decoded element value (Core §A.11).
Container variants carry no members: they mark the start of a container, whose
members follow as further elements until Value::EndOfContainer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Signed(i64)
A signed integer, sign-extended from its encoded width.
Unsigned(u64)
An unsigned integer, zero-extended from its encoded width.
Bool(bool)
A boolean, whose value lives in the control octet.
Float(f32)
A single-precision float.
Double(f64)
A double-precision float.
Utf8(&'a str)
A UTF-8 string, validated on read (§A.11.2).
Octets(&'a [u8])
An octet string.
Null
The null value.
Container(ContainerKind)
The start of a container.
EndOfContainer
The end of the innermost open container.
Implementations§
Source§impl Value<'_>
impl Value<'_>
Sourcepub const fn is_null(self) -> bool
pub const fn is_null(self) -> bool
Whether this is TLV null.
Matter’s X quality makes null a value, distinct from an absent field: §11.9.6.6’s
LastNetworkingStatus is null when nothing has been attempted and 0 when the last
attempt succeeded, which are different claims. A decoder that treated the two alike
would report success for a device that has never tried.
Sourcepub const fn container(self) -> Option<ContainerKind>
pub const fn container(self) -> Option<ContainerKind>
The container this value opens, if it opens one.