pub enum FieldValue {
Show 19 variants
OctetArray(Vec<u8>),
Unsigned(u64),
Unsigned256([u8; 32]),
Signed(i64),
Float32(f32),
Float64(f64),
Boolean(bool),
MacAddress(MacAddress),
String(String),
DateTimeSeconds(u32),
DateTimeMilliseconds(u64),
DateTimeMicroseconds(NtpTimestamp),
DateTimeNanoseconds(NtpTimestamp),
Ipv4Address(Ipv4Addr),
Ipv6Address(Ipv6Addr),
BasicList(BasicList),
SubTemplateList(SubTemplateList),
SubTemplateMultiList(SubTemplateMultiList),
Raw(Vec<u8>),
}Expand description
A decoded Information Element value
The variant is chosen from the abstract data type of the Information
Element in the IANA registry. Values that cannot be decoded with that type
(unknown or enterprise-specific Information Element, length not allowed for
the type, invalid UTF-8, unknown Template in a subTemplateList, …) are
kept as FieldValue::Raw rather than failing the whole Message.
Variants§
OctetArray(Vec<u8>)
octetArray
Unsigned(u64)
unsigned8, unsigned16, unsigned32, unsigned64 (possibly reduced-size)
Unsigned256([u8; 32])
unsigned256 (RFC 9740), big-endian, left-padded with zeros if reduced-size
Signed(i64)
signed8, signed16, signed32, signed64 (possibly reduced-size, sign extended as per RFC 7011 Errata 7875)
Float32(f32)
float32
Float64(f64)
float64 (possibly reduced-size to float32)
Boolean(bool)
boolean (RFC 7011 Section 6.1.5: 1 = true, 2 = false)
MacAddress(MacAddress)
macAddress
String(String)
string (UTF-8)
DateTimeSeconds(u32)
dateTimeSeconds: seconds since the UNIX epoch
DateTimeMilliseconds(u64)
dateTimeMilliseconds: milliseconds since the UNIX epoch
DateTimeMicroseconds(NtpTimestamp)
dateTimeMicroseconds: NTP timestamp
DateTimeNanoseconds(NtpTimestamp)
dateTimeNanoseconds: NTP timestamp
Ipv4Address(Ipv4Addr)
ipv4Address
Ipv6Address(Ipv6Addr)
ipv6Address
BasicList(BasicList)
basicList (RFC 6313)
SubTemplateList(SubTemplateList)
subTemplateList (RFC 6313)
SubTemplateMultiList(SubTemplateMultiList)
subTemplateMultiList (RFC 6313)
Raw(Vec<u8>)
Undecoded value (see the type-level documentation)