pub struct UType { /* private fields */ }Implementations§
Source§impl UType
impl UType
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 UType
impl UType
Sourcepub fn opcode_or_err(
&self,
) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
pub fn opcode_or_err( &self, ) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
Returns the value of opcode.
#Errors
If the returned value contains an invalid bit pattern for opcode.
Sourcepub fn with_opcode(self, new_val: <B7 as Specifier>::InOut) -> Self
pub fn with_opcode(self, new_val: <B7 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of opcode set to the given value.
#Panics
If the given value is out of bounds for opcode.
Sourcepub fn with_opcode_checked(
self,
new_val: <B7 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_opcode_checked( self, new_val: <B7 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of opcode set to the given value.
#Errors
If the given value is out of bounds for opcode.
Sourcepub fn set_opcode(&mut self, new_val: <B7 as Specifier>::InOut)
pub fn set_opcode(&mut self, new_val: <B7 as Specifier>::InOut)
Sets the value of opcode to the given value.
#Panics
If the given value is out of bounds for opcode.
Sourcepub fn set_opcode_checked(
&mut self,
new_val: <B7 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_opcode_checked( &mut self, new_val: <B7 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of opcode to the given value.
#Errors
If the given value is out of bounds for opcode.
Sourcepub fn rd_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn rd_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of rd.
#Errors
If the returned value contains an invalid bit pattern for rd.
Sourcepub fn with_rd(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_rd(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of rd set to the given value.
#Panics
If the given value is out of bounds for rd.
Sourcepub fn with_rd_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rd_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of rd set to the given value.
#Errors
If the given value is out of bounds for rd.
Sourcepub fn set_rd(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_rd(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of rd to the given value.
#Panics
If the given value is out of bounds for rd.
Sourcepub fn set_rd_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rd_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of rd to the given value.
#Errors
If the given value is out of bounds for rd.
Sourcepub fn imm31_12_or_err(
&self,
) -> Result<<B20 as Specifier>::InOut, InvalidBitPattern<<B20 as Specifier>::Bytes>>
pub fn imm31_12_or_err( &self, ) -> Result<<B20 as Specifier>::InOut, InvalidBitPattern<<B20 as Specifier>::Bytes>>
Returns the value of imm31_12.
#Errors
If the returned value contains an invalid bit pattern for imm31_12.
Sourcepub fn with_imm31_12(self, new_val: <B20 as Specifier>::InOut) -> Self
pub fn with_imm31_12(self, new_val: <B20 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of imm31_12 set to the given value.
#Panics
If the given value is out of bounds for imm31_12.
Sourcepub fn with_imm31_12_checked(
self,
new_val: <B20 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_imm31_12_checked( self, new_val: <B20 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of imm31_12 set to the given value.
#Errors
If the given value is out of bounds for imm31_12.
Sourcepub fn set_imm31_12(&mut self, new_val: <B20 as Specifier>::InOut)
pub fn set_imm31_12(&mut self, new_val: <B20 as Specifier>::InOut)
Sets the value of imm31_12 to the given value.
#Panics
If the given value is out of bounds for imm31_12.
Sourcepub fn set_imm31_12_checked(
&mut self,
new_val: <B20 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_imm31_12_checked( &mut self, new_val: <B20 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of imm31_12 to the given value.
#Errors
If the given value is out of bounds for imm31_12.