pub struct DataHeader { /* private fields */ }Implementations§
Source§impl DataHeader
impl DataHeader
Source§impl DataHeader
impl DataHeader
Sourcepub const fn into_bytes(self) -> [u8; 4]
pub const fn into_bytes(self) -> [u8; 4]
Sourcepub const fn from_bytes(bytes: [u8; 4]) -> Self
pub const fn from_bytes(bytes: [u8; 4]) -> Self
Converts the given bytes directly into the bitfield struct.
Source§impl DataHeader
impl DataHeader
Sourcepub fn packet_type(&self) -> <B7 as Specifier>::InOut
pub fn packet_type(&self) -> <B7 as Specifier>::InOut
Returns the value of packet_type.
Sourcepub fn packet_type_or_err(
&self,
) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
pub fn packet_type_or_err( &self, ) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
Returns the value of packet_type.
§Errors
If the returned value contains an invalid bit pattern for packet_type.
Sourcepub fn with_packet_type(self, new_val: <B7 as Specifier>::InOut) -> Self
pub fn with_packet_type(self, new_val: <B7 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of packet_type set to the given value.
§Panics
If the given value is out of bounds for packet_type.
Sourcepub fn with_packet_type_checked(
self,
new_val: <B7 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_packet_type_checked( self, new_val: <B7 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of packet_type set to the given value.
§Errors
If the given value is out of bounds for packet_type.
Sourcepub fn set_packet_type(&mut self, new_val: <B7 as Specifier>::InOut)
pub fn set_packet_type(&mut self, new_val: <B7 as Specifier>::InOut)
Sets the value of packet_type to the given value.
§Panics
If the given value is out of bounds for packet_type.
Sourcepub fn set_packet_type_checked(
&mut self,
new_val: <B7 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_packet_type_checked( &mut self, new_val: <B7 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of packet_type to the given value.
§Errors
If the given value is out of bounds for packet_type.
Sourcepub fn reserved_flag(&self) -> <bool as Specifier>::InOut
pub fn reserved_flag(&self) -> <bool as Specifier>::InOut
Returns the value of reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn reserved_flag_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn reserved_flag_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of reserved_flag.
§Errors
If the returned value contains an invalid bit pattern for reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn with_reserved_flag(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_reserved_flag(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of reserved_flag set to the given value.
§Panics
If the given value is out of bounds for reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn with_reserved_flag_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_reserved_flag_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of reserved_flag set to the given value.
§Errors
If the given value is out of bounds for reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn set_reserved_flag(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_reserved_flag(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of reserved_flag to the given value.
§Panics
If the given value is out of bounds for reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn set_reserved_flag_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_reserved_flag_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of reserved_flag to the given value.
§Errors
If the given value is out of bounds for reserved_flag.
Reserved flag bit in the first byte, purpose unknown.
IMPORTANT: This is NOT an indicator that an “extended header” is present.
As per protocol research, PutData (0x41) packets always include a 4-byte
extended header regardless of this bit.
Sourcepub fn id_or_err(
&self,
) -> Result<<u8 as Specifier>::InOut, InvalidBitPattern<<u8 as Specifier>::Bytes>>
pub fn id_or_err( &self, ) -> Result<<u8 as Specifier>::InOut, InvalidBitPattern<<u8 as Specifier>::Bytes>>
Sourcepub fn with_id(self, new_val: <u8 as Specifier>::InOut) -> Self
pub fn with_id(self, new_val: <u8 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of id set to the given value.
§Panics
If the given value is out of bounds for id.
Sourcepub fn with_id_checked(
self,
new_val: <u8 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_id_checked( self, new_val: <u8 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of id set to the given value.
§Errors
If the given value is out of bounds for id.
Sourcepub fn set_id_checked(
&mut self,
new_val: <u8 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_id_checked( &mut self, new_val: <u8 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sourcepub fn obj_count_words(&self) -> <B10 as Specifier>::InOut
pub fn obj_count_words(&self) -> <B10 as Specifier>::InOut
Returns the value of obj_count_words.
Sourcepub fn obj_count_words_or_err(
&self,
) -> Result<<B10 as Specifier>::InOut, InvalidBitPattern<<B10 as Specifier>::Bytes>>
pub fn obj_count_words_or_err( &self, ) -> Result<<B10 as Specifier>::InOut, InvalidBitPattern<<B10 as Specifier>::Bytes>>
Returns the value of obj_count_words.
§Errors
If the returned value contains an invalid bit pattern for obj_count_words.
Sourcepub fn with_obj_count_words(self, new_val: <B10 as Specifier>::InOut) -> Self
pub fn with_obj_count_words(self, new_val: <B10 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of obj_count_words set to the given value.
§Panics
If the given value is out of bounds for obj_count_words.
Sourcepub fn with_obj_count_words_checked(
self,
new_val: <B10 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_obj_count_words_checked( self, new_val: <B10 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of obj_count_words set to the given value.
§Errors
If the given value is out of bounds for obj_count_words.
Sourcepub fn set_obj_count_words(&mut self, new_val: <B10 as Specifier>::InOut)
pub fn set_obj_count_words(&mut self, new_val: <B10 as Specifier>::InOut)
Sets the value of obj_count_words to the given value.
§Panics
If the given value is out of bounds for obj_count_words.
Sourcepub fn set_obj_count_words_checked(
&mut self,
new_val: <B10 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_obj_count_words_checked( &mut self, new_val: <B10 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of obj_count_words to the given value.
§Errors
If the given value is out of bounds for obj_count_words.
Trait Implementations§
Source§impl CheckTotalSizeMultipleOf8 for DataHeader
impl CheckTotalSizeMultipleOf8 for DataHeader
type Size = TotalSize<BitCount<#[derive(Debug, Clone, Copy, PartialEq)] pub struct DataHeader { pub packet_type: B7, /// Reserved flag bit in the first byte, purpose unknown. /// IMPORTANT: This is NOT an indicator that an "extended header" is present. /// As per protocol research, PutData (0x41) packets always include a 4-byte /// extended header regardless of this bit. pub reserved_flag: bool, pub id: u8, #[skip] unused: B6, pub obj_count_words: B10, }>>
Source§impl Clone for DataHeader
impl Clone for DataHeader
Source§fn clone(&self) -> DataHeader
fn clone(&self) -> DataHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more