pub struct Ipv6ExtHeader<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an IPv6 Extension Header buffer.
Implementations§
Source§impl<T: AsRef<[u8]>> Header<T>
impl<T: AsRef<[u8]>> Header<T>
Core getter methods relevant to any IPv6 extension header.
Sourcepub const fn new_unchecked(buffer: T) -> Self
pub const fn new_unchecked(buffer: T) -> Self
Create a raw octet buffer with an IPv6 Extension Header structure.
Sourcepub fn new_checked(buffer: T) -> Result<Self>
pub fn new_checked(buffer: T) -> Result<Self>
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) -> IpProtocol
pub fn next_header(&self) -> IpProtocol
Return the next header field.
Sourcepub fn header_len(&self) -> u8
pub fn header_len(&self) -> u8
Return the header length field.
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: IpProtocol)
pub fn set_next_header(&mut self, value: IpProtocol)
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 extension header data length. The length of the header is in 8-octet units, not including the first 8 octets.
Trait Implementations§
impl<T: Eq + AsRef<[u8]>> Eq for Header<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for Header<T>
Auto Trait Implementations§
impl<T> Freeze for Header<T>where
T: Freeze,
impl<T> RefUnwindSafe for Header<T>where
T: RefUnwindSafe,
impl<T> Send for Header<T>where
T: Send,
impl<T> Sync for Header<T>where
T: Sync,
impl<T> Unpin for Header<T>where
T: Unpin,
impl<T> UnwindSafe for Header<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more