Struct smoltcp::wire::Ipv6HopByHopHeader
source · pub struct Ipv6HopByHopHeader<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an IPv6 Hop-by-Hop Options Header.
Implementations§
source§impl<T: AsRef<[u8]>> Header<T>
impl<T: AsRef<[u8]>> Header<T>
sourcepub const fn new_unchecked(buffer: T) -> Header<T>
pub const fn new_unchecked(buffer: T) -> Header<T>
Create a raw octet buffer with an IPv6 Hop-by-Hop Options Header structure.
sourcepub fn new_checked(buffer: T) -> Result<Header<T>>
pub fn new_checked(buffer: T) -> Result<Header<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_header_len.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the header, returning the underlying buffer.
sourcepub fn next_header(&self) -> Protocol
pub fn next_header(&self) -> Protocol
Return the next header field.
sourcepub fn header_len(&self) -> u8
pub fn header_len(&self) -> u8
Return length of the Hop-by-Hop Options header in 8-octet units, not including the first 8 octets.
source§impl<T: AsRef<[u8]> + AsMut<[u8]>> Header<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Header<T>
sourcepub fn set_next_header(&mut self, value: Protocol)
pub fn set_next_header(&mut self, value: Protocol)
Set the next header field.
sourcepub fn set_header_len(&mut self, value: u8)
pub fn set_header_len(&mut self, value: u8)
Set the option data length. Length of the Hop-by-Hop Options header in 8-octet units, not including the first 8 octets.