pub enum DhcpOption<'a> {
Show 14 variants ClientId(&'a [u8]), ServerId(&'a [u8]), Iana(IanaSerializer<'a>), IaAddr(IaAddrSerializer<'a>), Oro(&'a [OptionCode]), Preference(u8), ElapsedTime(u16), StatusCode(u16, &'a str), IaPd(IaPdSerializer<'a>), IaPrefix(IaPrefixSerializer<'a>), InformationRefreshTime(u32), SolMaxRt(u32), DnsServers(&'a [Ipv6Addr]), DomainList(&'a [Domain]),
}
Expand description

A serializable DHCPv6 option.

Options that are not found in this type are currently not supported. An exhaustive list of options can be found here.

Variants§

§

ClientId(&'a [u8])

§

ServerId(&'a [u8])

§

Iana(IanaSerializer<'a>)

§

IaAddr(IaAddrSerializer<'a>)

§

Oro(&'a [OptionCode])

§

Preference(u8)

§

ElapsedTime(u16)

§

StatusCode(u16, &'a str)

§

IaPd(IaPdSerializer<'a>)

§

IaPrefix(IaPrefixSerializer<'a>)

§

InformationRefreshTime(u32)

§

SolMaxRt(u32)

§

DnsServers(&'a [Ipv6Addr])

§

DomainList(&'a [Domain])

Implementations§

source§

impl DhcpOption<'_>

source

pub fn code(&self) -> OptionCode

Returns the corresponding option code for the calling option.

Trait Implementations§

source§

impl<'a> Debug for DhcpOption<'a>

source§

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

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

impl<'a> RecordBuilder for DhcpOption<'a>

source§

fn serialized_len(&self) -> usize

Calculates the serialized length of the option based on option format defined in RFC 8415, Section 21.1.

For variable length options that exceeds the size limit (u16::MAX), fallback to a default value.

source§

fn serialize_into(&self, buf: &mut [u8])

Serializes an option and appends to input buffer based on option format defined in RFC 8415, Section 21.1.

For variable length options that exceeds the size limit (u16::MAX), fallback to use a default value instead, so it is impossible for future changes to introduce DoS vulnerabilities even if they accidentally allow such options to be injected.

§Panics

serialize_into panics if buf is too small to hold the serialized form of self.

Auto Trait Implementations§

§

impl<'a> Freeze for DhcpOption<'a>

§

impl<'a> RefUnwindSafe for DhcpOption<'a>

§

impl<'a> Send for DhcpOption<'a>

§

impl<'a> Sync for DhcpOption<'a>

§

impl<'a> Unpin for DhcpOption<'a>

§

impl<'a> UnwindSafe for DhcpOption<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.