pub struct FragmentHeaderWriter<'a> {
pub bytes: &'a mut [u8],
}
Expand description
Writes the Fragment header fields.
Fields§
§bytes: &'a mut [u8]
Implementations§
Source§impl<'a> FragmentHeaderWriter<'a>
impl<'a> FragmentHeaderWriter<'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 FragmentHeaderWriter
from the given data slice.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Returns the length of the Fragment header.
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.
Identifies the type of the next header.
Sourcepub fn set_reserved(&mut self, reserved: u8)
pub fn set_reserved(&mut self, reserved: u8)
Sets the reserved field.
Should be all zeroes.
Sourcepub fn set_fragment_offset(&mut self, fragment_offset: u16)
pub fn set_fragment_offset(&mut self, fragment_offset: u16)
Sets the fragment offset field.
Offset in 8 bytes relative to the start of the fragmentable part of the original packet.
Sourcepub fn set_m_flag(&mut self, m_flag: bool)
pub fn set_m_flag(&mut self, m_flag: bool)
Sets the M flag.
1 means more fragments follow, 0 means this is the last fragment.
Sourcepub fn set_identification(&mut self, identification: u32)
pub fn set_identification(&mut self, identification: u32)
Sets the identification field.
Identifies the packet, generated by the sender, to help the receiver reassemble the fragments.
Auto Trait Implementations§
impl<'a> Freeze for FragmentHeaderWriter<'a>
impl<'a> RefUnwindSafe for FragmentHeaderWriter<'a>
impl<'a> Send for FragmentHeaderWriter<'a>
impl<'a> Sync for FragmentHeaderWriter<'a>
impl<'a> Unpin for FragmentHeaderWriter<'a>
impl<'a> !UnwindSafe for FragmentHeaderWriter<'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