Struct smoltcp::wire::Ipv6Option[][src]

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

A read/write wrapper around an IPv6 Extension Header Option.

Implementations

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

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

Create a raw octet buffer with an IPv6 Extension Header Option structure.

pub fn new_checked(buffer: T) -> Result<Ipv6Option<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 ipv6 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.

Panics

This function panics if this is an 1-byte padding option.

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

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

Return the option data.

Panics

This function panics if this is an 1-byte padding option.

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

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.

Panics

This function panics if this is an 1-byte padding option.

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

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

Return a mutable pointer to the option data.

Panics

This function panics if this is an 1-byte padding option.

Trait Implementations

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

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Ipv6Option<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.