pub struct Ipv6FragmentHeader<T: AsRef<[u8]>> { /* private fields */ }
Expand description
A read/write wrapper around an IPv6 Fragment 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 Fragment 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.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the header, returning the underlying buffer.
Sourcepub fn frag_offset(&self) -> u16
pub fn frag_offset(&self) -> u16
Return the fragment offset field.
Sourcepub fn more_frags(&self) -> bool
pub fn more_frags(&self) -> bool
Return more fragment flag field.
Source§impl<T: AsRef<[u8]> + AsMut<[u8]>> Header<T>
impl<T: AsRef<[u8]> + AsMut<[u8]>> Header<T>
Sourcepub fn clear_reserved(&mut self)
pub fn clear_reserved(&mut self)
Set reserved fields.
Set 8-bit reserved field after the next header field. Set 2-bit reserved field between fragment offset and more fragments.
Sourcepub fn set_frag_offset(&mut self, value: u16)
pub fn set_frag_offset(&mut self, value: u16)
Set the fragment offset field.
Sourcepub fn set_more_frags(&mut self, value: bool)
pub fn set_more_frags(&mut self, value: bool)
Set the more fragments flag field.
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