Struct smoltcp::wire::Ipv6Option
source · 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 fn new_unchecked(buffer: T) -> Ipv6Option<T>
pub 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::Truncated)
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.