pub struct NdiscOption<T: AsRef<[u8]>> { /* private fields */ }
Expand description

A read/write wrapper around an NDISC Option.

Implementations

Core getter methods relevant to any type of NDISC option.

Create a raw octet buffer with an NDISC Option structure.

Shorthand for a combination of new_unchecked and check_len.

Ensure that no accessor method will panic if called. Returns Err(Error::Truncated) if the buffer is too short.

The result of this check is invalidated by calling set_data_len.

Consume the NDISC option, returning the underlying buffer.

Return the option type.

Return the length of the data.

Getter methods only relevant for Source/Target Link-layer Address options.

Return the Source/Target Link-layer Address.

Getter methods only relevant for the MTU option.

Return the MTU value.

Getter methods only relevant for the Prefix Information option.

Return the prefix length.

Return the prefix information flags.

Return the valid lifetime of the prefix.

Return the preferred lifetime of the prefix.

Return the prefix.

Return the option data.

Core setter methods relevant to any type of NDISC option.

Set the option type.

Set the option data length.

Setter methods only relevant for Source/Target Link-layer Address options.

Set the Source/Target Link-layer Address.

Setter methods only relevant for the MTU option.

Set the MTU value.

Setter methods only relevant for the Prefix Information option.

Set the prefix length.

Set the prefix information flags.

Set the valid lifetime of the prefix.

Set the preferred lifetime of the prefix.

Clear the reserved bits.

Set the prefix.

Setter methods only relevant for the Redirected Header option.

Clear the reserved bits.

Return a mutable pointer to the option data.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.