Struct smoltcp::wire::Ipv6Option
source · pub struct Ipv6Option<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an IPv6 Extension Header Option.
Implementations§
source§impl<T: AsRef<[u8]>> Ipv6Option<T>
impl<T: AsRef<[u8]>> Ipv6Option<T>
sourcepub const fn new_unchecked(buffer: T) -> Ipv6Option<T>
pub const fn new_unchecked(buffer: T) -> Ipv6Option<T>
Create a raw octet buffer with an IPv6 Extension Header Option structure.
sourcepub fn new_checked(buffer: T) -> Result<Ipv6Option<T>>
pub fn new_checked(buffer: T) -> Result<Ipv6Option<T>>
Shorthand for a combination of new_unchecked and check_len.
sourcepub fn check_len(&self) -> Result<()>
pub fn check_len(&self) -> Result<()>
Ensure that no accessor method will panic if called.
Returns Err(Error)
if the buffer is too short.
The result of this check is invalidated by calling set_data_len.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the ipv6 option, returning the underlying buffer.
sourcepub fn option_type(&self) -> Type
pub fn option_type(&self) -> Type
Return the option type.
source§impl<T: AsRef<[u8]> + AsMut<[u8]>> Ipv6Option<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Ipv6Option<T>
sourcepub fn set_option_type(&mut self, value: Type)
pub fn set_option_type(&mut self, value: Type)
Set the option type.
sourcepub fn set_data_len(&mut self, value: u8)
pub fn set_data_len(&mut self, value: u8)
Trait Implementations§
source§impl<T: PartialEq + AsRef<[u8]>> PartialEq<Ipv6Option<T>> for Ipv6Option<T>
impl<T: PartialEq + AsRef<[u8]>> PartialEq<Ipv6Option<T>> for Ipv6Option<T>
source§fn eq(&self, other: &Ipv6Option<T>) -> bool
fn eq(&self, other: &Ipv6Option<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.