pub struct Ipv6ExtHeader<'a> { /* private fields */ }Expand description
A read wrapper around an IPv6 extension header.
All IPv6 extension headers (except Fragment) share the same layout: a next header field, a length field in units of 8 octets not counting the first 8, and header-specific data.
Implementations§
Source§impl<'a> ExtHeader<'a>
impl<'a> ExtHeader<'a>
Sourcepub const fn new_unchecked(buffer: &'a [u8]) -> ExtHeader<'a>
pub const fn new_unchecked(buffer: &'a [u8]) -> ExtHeader<'a>
Imbue a raw octet buffer with extension header structure.
Sourcepub fn new_checked(buffer: &'a [u8]) -> Result<ExtHeader<'a>>
pub fn new_checked(buffer: &'a [u8]) -> Result<ExtHeader<'a>>
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.
Sourcepub fn next_header(&self) -> Protocol
pub fn next_header(&self) -> Protocol
Return the next header field.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Return the length of the whole extension header, in bytes.
Trait Implementations§
impl<'a> Eq for ExtHeader<'a>
impl<'a> StructuralPartialEq for ExtHeader<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExtHeader<'a>
impl<'a> RefUnwindSafe for ExtHeader<'a>
impl<'a> Send for ExtHeader<'a>
impl<'a> Sync for ExtHeader<'a>
impl<'a> Unpin for ExtHeader<'a>
impl<'a> UnsafeUnpin for ExtHeader<'a>
impl<'a> UnwindSafe for ExtHeader<'a>
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