pub struct OptionsHeaderWriter<'a> {
pub bytes: &'a mut [u8],
}
Expand description
Writes an Options extension header fields.
May be Hop-by-Hop or Destination Options.
Fields§
§bytes: &'a mut [u8]
Implementations§
Source§impl<'a> OptionsHeaderWriter<'a>
impl<'a> OptionsHeaderWriter<'a>
Sourcepub fn new(bytes: &'a mut [u8]) -> Result<Self, &'static str>
pub fn new(bytes: &'a mut [u8]) -> Result<Self, &'static str>
Creates a new OptionsHeaderWriter
from the given data slice.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the total Wheader length in bytes.
Sourcepub fn set_next_header(&mut self, next_header: u8)
pub fn set_next_header(&mut self, next_header: u8)
Sets the next header field.
Specifies the type of the next header.
Sourcepub fn set_header_ext_len(&mut self, header_ext_len: u8)
pub fn set_header_ext_len(&mut self, header_ext_len: u8)
Sets 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.
Auto Trait Implementations§
impl<'a> Freeze for OptionsHeaderWriter<'a>
impl<'a> RefUnwindSafe for OptionsHeaderWriter<'a>
impl<'a> Send for OptionsHeaderWriter<'a>
impl<'a> Sync for OptionsHeaderWriter<'a>
impl<'a> Unpin for OptionsHeaderWriter<'a>
impl<'a> !UnwindSafe for OptionsHeaderWriter<'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