pub struct OptionsHeaderReader<'a> {
pub bytes: &'a [u8],
}
Fields§
§bytes: &'a [u8]
Implementations§
Source§impl<'a> OptionsHeaderReader<'a>
impl<'a> OptionsHeaderReader<'a>
Sourcepub fn new(bytes: &'a [u8]) -> Result<Self, &'static str>
pub fn new(bytes: &'a [u8]) -> Result<Self, &'static str>
Creates a new OptionsHeaderReader
from the given data slice.
Sourcepub fn next_header(&self) -> u8
pub fn next_header(&self) -> u8
Returns the next header field.
Specifies the type of the next header.
Sourcepub fn header_ext_len(&self) -> u8
pub fn header_ext_len(&self) -> u8
Returns the header extension length field.
Length of the header in 8 bytes, not including the first 8 bytes.
E.g. Header length = (header_ext_len + 1) * 8.
Sourcepub fn options(&self) -> Result<&'a [u8], &'static str>
pub fn options(&self) -> Result<&'a [u8], &'static str>
Returns the options and padding fields.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the total header length in bytes.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for OptionsHeaderReader<'a>
impl<'a> RefUnwindSafe for OptionsHeaderReader<'a>
impl<'a> Send for OptionsHeaderReader<'a>
impl<'a> Sync for OptionsHeaderReader<'a>
impl<'a> Unpin for OptionsHeaderReader<'a>
impl<'a> UnwindSafe for OptionsHeaderReader<'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