pub struct Fragmentation { /* private fields */ }
Expand description
Fragmentation flags and offset info
Implementations§
Source§impl Fragmentation
impl Fragmentation
Source§impl Fragmentation
impl Fragmentation
Sourcepub const fn into_bytes(self) -> [u8; 2]
pub const fn into_bytes(self) -> [u8; 2]
Sourcepub const fn from_bytes(bytes: [u8; 2]) -> Self
pub const fn from_bytes(bytes: [u8; 2]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl Fragmentation
impl Fragmentation
Sourcepub fn do_not_fragment(&self) -> <B1 as Specifier>::InOut
pub fn do_not_fragment(&self) -> <B1 as Specifier>::InOut
Returns the value of do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn do_not_fragment_or_err(
&self,
) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
pub fn do_not_fragment_or_err( &self, ) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
Returns the value of do_not_fragment.
#Errors
If the returned value contains an invalid bit pattern for do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn with_do_not_fragment(self, new_val: <B1 as Specifier>::InOut) -> Self
pub fn with_do_not_fragment(self, new_val: <B1 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of do_not_fragment set to the given value.
#Panics
If the given value is out of bounds for do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn with_do_not_fragment_checked(
self,
new_val: <B1 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_do_not_fragment_checked( self, new_val: <B1 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of do_not_fragment set to the given value.
#Errors
If the given value is out of bounds for do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn set_do_not_fragment(&mut self, new_val: <B1 as Specifier>::InOut)
pub fn set_do_not_fragment(&mut self, new_val: <B1 as Specifier>::InOut)
Sets the value of do_not_fragment to the given value.
#Panics
If the given value is out of bounds for do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn set_do_not_fragment_checked(
&mut self,
new_val: <B1 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_do_not_fragment_checked( &mut self, new_val: <B1 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of do_not_fragment to the given value.
#Errors
If the given value is out of bounds for do_not_fragment. Flag for routers to drop packets instead of fragmenting
Sourcepub fn more_fragments(&self) -> <B1 as Specifier>::InOut
pub fn more_fragments(&self) -> <B1 as Specifier>::InOut
Returns the value of more_fragments. Flag that there are more fragments coming
Sourcepub fn more_fragments_or_err(
&self,
) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
pub fn more_fragments_or_err( &self, ) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
Returns the value of more_fragments.
#Errors
If the returned value contains an invalid bit pattern for more_fragments. Flag that there are more fragments coming
Sourcepub fn with_more_fragments(self, new_val: <B1 as Specifier>::InOut) -> Self
pub fn with_more_fragments(self, new_val: <B1 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of more_fragments set to the given value.
#Panics
If the given value is out of bounds for more_fragments. Flag that there are more fragments coming
Sourcepub fn with_more_fragments_checked(
self,
new_val: <B1 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_more_fragments_checked( self, new_val: <B1 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of more_fragments set to the given value.
#Errors
If the given value is out of bounds for more_fragments. Flag that there are more fragments coming
Sourcepub fn set_more_fragments(&mut self, new_val: <B1 as Specifier>::InOut)
pub fn set_more_fragments(&mut self, new_val: <B1 as Specifier>::InOut)
Sets the value of more_fragments to the given value.
#Panics
If the given value is out of bounds for more_fragments. Flag that there are more fragments coming
Sourcepub fn set_more_fragments_checked(
&mut self,
new_val: <B1 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_more_fragments_checked( &mut self, new_val: <B1 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of more_fragments to the given value.
#Errors
If the given value is out of bounds for more_fragments. Flag that there are more fragments coming
Sourcepub fn offset(&self) -> <B13 as Specifier>::InOut
pub fn offset(&self) -> <B13 as Specifier>::InOut
Returns the value of offset. Where we are in a set of fragments
Sourcepub fn offset_or_err(
&self,
) -> Result<<B13 as Specifier>::InOut, InvalidBitPattern<<B13 as Specifier>::Bytes>>
pub fn offset_or_err( &self, ) -> Result<<B13 as Specifier>::InOut, InvalidBitPattern<<B13 as Specifier>::Bytes>>
Returns the value of offset.
#Errors
If the returned value contains an invalid bit pattern for offset. Where we are in a set of fragments
Sourcepub fn with_offset(self, new_val: <B13 as Specifier>::InOut) -> Self
pub fn with_offset(self, new_val: <B13 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of offset set to the given value.
#Panics
If the given value is out of bounds for offset. Where we are in a set of fragments
Sourcepub fn with_offset_checked(
self,
new_val: <B13 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_offset_checked( self, new_val: <B13 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of offset set to the given value.
#Errors
If the given value is out of bounds for offset. Where we are in a set of fragments
Sourcepub fn set_offset(&mut self, new_val: <B13 as Specifier>::InOut)
pub fn set_offset(&mut self, new_val: <B13 as Specifier>::InOut)
Sets the value of offset to the given value.
#Panics
If the given value is out of bounds for offset. Where we are in a set of fragments
Sourcepub fn set_offset_checked(
&mut self,
new_val: <B13 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_offset_checked( &mut self, new_val: <B13 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of offset to the given value.
#Errors
If the given value is out of bounds for offset. Where we are in a set of fragments
Trait Implementations§
Source§impl ByteStruct for Fragmentation
impl ByteStruct for Fragmentation
Source§fn read_bytes(bytes: &[u8]) -> Self
fn read_bytes(bytes: &[u8]) -> Self
Source§fn write_bytes(&self, bytes: &mut [u8])
fn write_bytes(&self, bytes: &mut [u8])
Source§impl ByteStructLen for Fragmentation
impl ByteStructLen for Fragmentation
Source§impl Clone for Fragmentation
impl Clone for Fragmentation
Source§fn clone(&self) -> Fragmentation
fn clone(&self) -> Fragmentation
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Fragmentation
impl Debug for Fragmentation
Source§impl Default for Fragmentation
impl Default for Fragmentation
Source§fn default() -> Fragmentation
fn default() -> Fragmentation
Source§impl PartialEq for Fragmentation
impl PartialEq for Fragmentation
Source§impl uDebug for Fragmentation
impl uDebug for Fragmentation
impl Copy for Fragmentation
impl Eq for Fragmentation
impl StructuralPartialEq for Fragmentation
Auto Trait Implementations§
impl Freeze for Fragmentation
impl RefUnwindSafe for Fragmentation
impl Send for Fragmentation
impl Sync for Fragmentation
impl Unpin for Fragmentation
impl UnwindSafe for Fragmentation
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
Source§impl<T> ByteStructUnspecifiedByteOrder for Twhere
T: ByteStruct,
impl<T> ByteStructUnspecifiedByteOrder for Twhere
T: ByteStruct,
Source§fn write_bytes_default_le(&self, bytes: &mut [u8])
fn write_bytes_default_le(&self, bytes: &mut [u8])
A wrapper of ByteStruct::write_bytes
Source§fn read_bytes_default_le(bytes: &[u8]) -> T
fn read_bytes_default_le(bytes: &[u8]) -> T
A wrapper of ByteStruct::read_bytes
Source§fn write_bytes_default_be(&self, bytes: &mut [u8])
fn write_bytes_default_be(&self, bytes: &mut [u8])
A wrapper of ByteStruct::write_bytes
Source§fn read_bytes_default_be(bytes: &[u8]) -> T
fn read_bytes_default_be(bytes: &[u8]) -> T
A wrapper of ByteStruct::read_bytes