Skip to main content

FieldValue

Enum FieldValue 

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

Trait Implementations§

Source§

impl Clone for FieldValue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FieldValue

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.