pub struct PriorityLevelMask { /* private fields */ }
Expand description
Mask representing which priority levels should be enabled/disabled
Implementations§
Source§impl PriorityLevelMask
impl PriorityLevelMask
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 PriorityLevelMask
impl PriorityLevelMask
Sourcepub fn level0_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn level0_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of level0.
#Errors
If the returned value contains an invalid bit pattern for level0. Level 0
Sourcepub fn with_level0(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_level0(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of level0 set to the given value.
#Panics
If the given value is out of bounds for level0. Level 0
Sourcepub fn with_level0_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_level0_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of level0 set to the given value.
#Errors
If the given value is out of bounds for level0. Level 0
Sourcepub fn set_level0(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_level0(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of level0 to the given value.
#Panics
If the given value is out of bounds for level0. Level 0
Sourcepub fn set_level0_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_level0_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of level0 to the given value.
#Errors
If the given value is out of bounds for level0. Level 0
Sourcepub fn level1_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn level1_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of level1.
#Errors
If the returned value contains an invalid bit pattern for level1. Level 1
Sourcepub fn with_level1(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_level1(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of level1 set to the given value.
#Panics
If the given value is out of bounds for level1. Level 1
Sourcepub fn with_level1_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_level1_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of level1 set to the given value.
#Errors
If the given value is out of bounds for level1. Level 1
Sourcepub fn set_level1(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_level1(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of level1 to the given value.
#Panics
If the given value is out of bounds for level1. Level 1
Sourcepub fn set_level1_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_level1_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of level1 to the given value.
#Errors
If the given value is out of bounds for level1. Level 1
Sourcepub fn level2_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn level2_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of level2.
#Errors
If the returned value contains an invalid bit pattern for level2. Level 2
Sourcepub fn with_level2(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_level2(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of level2 set to the given value.
#Panics
If the given value is out of bounds for level2. Level 2
Sourcepub fn with_level2_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_level2_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of level2 set to the given value.
#Errors
If the given value is out of bounds for level2. Level 2
Sourcepub fn set_level2(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_level2(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of level2 to the given value.
#Panics
If the given value is out of bounds for level2. Level 2
Sourcepub fn set_level2_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_level2_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of level2 to the given value.
#Errors
If the given value is out of bounds for level2. Level 2
Sourcepub fn level3_or_err(
&self,
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
pub fn level3_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of level3.
#Errors
If the returned value contains an invalid bit pattern for level3. Level 3
Sourcepub fn with_level3(self, new_val: <bool as Specifier>::InOut) -> Self
pub fn with_level3(self, new_val: <bool as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of level3 set to the given value.
#Panics
If the given value is out of bounds for level3. Level 3
Sourcepub fn with_level3_checked(
self,
new_val: <bool as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_level3_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of level3 set to the given value.
#Errors
If the given value is out of bounds for level3. Level 3
Sourcepub fn set_level3(&mut self, new_val: <bool as Specifier>::InOut)
pub fn set_level3(&mut self, new_val: <bool as Specifier>::InOut)
Sets the value of level3 to the given value.
#Panics
If the given value is out of bounds for level3. Level 3
Sourcepub fn set_level3_checked(
&mut self,
new_val: <bool as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_level3_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of level3 to the given value.
#Errors
If the given value is out of bounds for level3. Level 3