pub struct CtrlHeader { /* private fields */ }Implementations§
Source§impl CtrlHeader
impl CtrlHeader
Source§impl CtrlHeader
impl CtrlHeader
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 CtrlHeader
impl CtrlHeader
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.
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.
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.
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.
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.
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.
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 attribute_or_err(
&self,
) -> Result<<B15 as Specifier>::InOut, InvalidBitPattern<<B15 as Specifier>::Bytes>>
pub fn attribute_or_err( &self, ) -> Result<<B15 as Specifier>::InOut, InvalidBitPattern<<B15 as Specifier>::Bytes>>
Returns the value of attribute.
§Errors
If the returned value contains an invalid bit pattern for attribute.
Sourcepub fn with_attribute(self, new_val: <B15 as Specifier>::InOut) -> Self
pub fn with_attribute(self, new_val: <B15 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of attribute set to the given value.
§Panics
If the given value is out of bounds for attribute.
Sourcepub fn with_attribute_checked(
self,
new_val: <B15 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_attribute_checked( self, new_val: <B15 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of attribute set to the given value.
§Errors
If the given value is out of bounds for attribute.
Sourcepub fn set_attribute(&mut self, new_val: <B15 as Specifier>::InOut)
pub fn set_attribute(&mut self, new_val: <B15 as Specifier>::InOut)
Sets the value of attribute to the given value.
§Panics
If the given value is out of bounds for attribute.
Sourcepub fn set_attribute_checked(
&mut self,
new_val: <B15 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_attribute_checked( &mut self, new_val: <B15 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of attribute to the given value.
§Errors
If the given value is out of bounds for attribute.
Trait Implementations§
Source§impl CheckTotalSizeMultipleOf8 for CtrlHeader
impl CheckTotalSizeMultipleOf8 for CtrlHeader
type Size = TotalSize<BitCount<#[derive(Debug, Clone, Copy, PartialEq)] pub struct CtrlHeader { 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. pub reserved_flag: bool, pub id: u8, #[skip] unused: bool, pub attribute: B15, }>>
Source§impl Clone for CtrlHeader
impl Clone for CtrlHeader
Source§fn clone(&self) -> CtrlHeader
fn clone(&self) -> CtrlHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more