Struct smoltcp::wire::NdiscOption[][src]

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

A read/write wrapper around an NDISC Option.

Implementations

impl<T: AsRef<[u8]>> NdiscOption<T>[src]

Core getter methods relevant to any type of NDISC option.

pub fn new_unchecked(buffer: T) -> NdiscOption<T>[src]

Create a raw octet buffer with an NDISC Option structure.

pub fn new_checked(buffer: T) -> Result<NdiscOption<T>>[src]

Shorthand for a combination of new_unchecked and check_len.

pub fn check_len(&self) -> Result<()>[src]

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.

pub fn into_inner(self) -> T[src]

Consume the NDISC option, returning the underlying buffer.

pub fn option_type(&self) -> Type[src]

Return the option type.

pub fn data_len(&self) -> u8[src]

Return the length of the data.

impl<T: AsRef<[u8]>> NdiscOption<T>[src]

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

Return the Source/Target Link-layer Address.

impl<T: AsRef<[u8]>> NdiscOption<T>[src]

Getter methods only relevant for the MTU option.

pub fn mtu(&self) -> u32[src]

Return the MTU value.

impl<T: AsRef<[u8]>> NdiscOption<T>[src]

Getter methods only relevant for the Prefix Information option.

pub fn prefix_len(&self) -> u8[src]

Return the prefix length.

pub fn prefix_flags(&self) -> PrefixInfoFlags[src]

Return the prefix information flags.

pub fn valid_lifetime(&self) -> Duration[src]

Return the valid lifetime of the prefix.

pub fn preferred_lifetime(&self) -> Duration[src]

Return the preferred lifetime of the prefix.

pub fn prefix(&self) -> Ipv6Address[src]

Return the prefix.

impl<'a, T: AsRef<[u8]> + ?Sized> NdiscOption<&'a T>[src]

pub fn data(&self) -> &'a [u8][src]

Return the option data.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>[src]

Core setter methods relevant to any type of NDISC option.

pub fn set_option_type(&mut self, value: Type)[src]

Set the option type.

pub fn set_data_len(&mut self, value: u8)[src]

Set the option data length.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>[src]

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

Set the Source/Target Link-layer Address.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>[src]

Setter methods only relevant for the MTU option.

pub fn set_mtu(&mut self, value: u32)[src]

Set the MTU value.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>[src]

Setter methods only relevant for the Prefix Information option.

pub fn set_prefix_len(&mut self, value: u8)[src]

Set the prefix length.

pub fn set_prefix_flags(&mut self, flags: PrefixInfoFlags)[src]

Set the prefix information flags.

pub fn set_valid_lifetime(&mut self, time: Duration)[src]

Set the valid lifetime of the prefix.

pub fn set_preferred_lifetime(&mut self, time: Duration)[src]

Set the preferred lifetime of the prefix.

pub fn clear_prefix_reserved(&mut self)[src]

Clear the reserved bits.

pub fn set_prefix(&mut self, addr: Ipv6Address)[src]

Set the prefix.

impl<T: AsRef<[u8]> + AsMut<[u8]>> NdiscOption<T>[src]

Setter methods only relevant for the Redirected Header option.

pub fn clear_redirected_reserved(&mut self)[src]

Clear the reserved bits.

impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> NdiscOption<&'a mut T>[src]

pub fn data_mut(&mut self) -> &mut [u8][src]

Return a mutable pointer to the option data.

Trait Implementations

impl<T: Debug + AsRef<[u8]>> Debug for NdiscOption<T>[src]

impl<'a, T: AsRef<[u8]> + ?Sized> Display for NdiscOption<&'a T>[src]

impl<T: PartialEq + AsRef<[u8]>> PartialEq<NdiscOption<T>> for NdiscOption<T>[src]

impl<T: AsRef<[u8]>> PrettyPrint for NdiscOption<T>[src]

impl<T: AsRef<[u8]>> StructuralPartialEq for NdiscOption<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for NdiscOption<T> where
    T: RefUnwindSafe

impl<T> Send for NdiscOption<T> where
    T: Send

impl<T> Sync for NdiscOption<T> where
    T: Sync

impl<T> Unpin for NdiscOption<T> where
    T: Unpin

impl<T> UnwindSafe for NdiscOption<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.