pub struct CIWType { /* private fields */ }Implementations§
Source§impl CIWType
impl CIWType
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 CIWType
impl CIWType
Sourcepub fn op_or_err(
&self,
) -> Result<<B2 as Specifier>::InOut, InvalidBitPattern<<B2 as Specifier>::Bytes>>
pub fn op_or_err( &self, ) -> Result<<B2 as Specifier>::InOut, InvalidBitPattern<<B2 as Specifier>::Bytes>>
Returns the value of op.
#Errors
If the returned value contains an invalid bit pattern for op.
Sourcepub fn with_op(self, new_val: <B2 as Specifier>::InOut) -> Self
pub fn with_op(self, new_val: <B2 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of op set to the given value.
#Panics
If the given value is out of bounds for op.
Sourcepub fn with_op_checked(
self,
new_val: <B2 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_op_checked( self, new_val: <B2 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of op set to the given value.
#Errors
If the given value is out of bounds for op.
Sourcepub fn set_op(&mut self, new_val: <B2 as Specifier>::InOut)
pub fn set_op(&mut self, new_val: <B2 as Specifier>::InOut)
Sets the value of op to the given value.
#Panics
If the given value is out of bounds for op.
Sourcepub fn set_op_checked(
&mut self,
new_val: <B2 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_op_checked( &mut self, new_val: <B2 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of op to the given value.
#Errors
If the given value is out of bounds for op.
Sourcepub fn rd_or_err(
&self,
) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 as Specifier>::Bytes>>
pub fn rd_or_err( &self, ) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 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: <B3 as Specifier>::InOut) -> Self
pub fn with_rd(self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rd_checked( self, new_val: <B3 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: <B3 as Specifier>::InOut)
pub fn set_rd(&mut self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rd_checked( &mut self, new_val: <B3 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 imm_b8_or_err(
&self,
) -> Result<<B8 as Specifier>::InOut, InvalidBitPattern<<B8 as Specifier>::Bytes>>
pub fn imm_b8_or_err( &self, ) -> Result<<B8 as Specifier>::InOut, InvalidBitPattern<<B8 as Specifier>::Bytes>>
Returns the value of imm_b8.
#Errors
If the returned value contains an invalid bit pattern for imm_b8.
Sourcepub fn with_imm_b8(self, new_val: <B8 as Specifier>::InOut) -> Self
pub fn with_imm_b8(self, new_val: <B8 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of imm_b8 set to the given value.
#Panics
If the given value is out of bounds for imm_b8.
Sourcepub fn with_imm_b8_checked(
self,
new_val: <B8 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_imm_b8_checked( self, new_val: <B8 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of imm_b8 set to the given value.
#Errors
If the given value is out of bounds for imm_b8.
Sourcepub fn set_imm_b8(&mut self, new_val: <B8 as Specifier>::InOut)
pub fn set_imm_b8(&mut self, new_val: <B8 as Specifier>::InOut)
Sets the value of imm_b8 to the given value.
#Panics
If the given value is out of bounds for imm_b8.
Sourcepub fn set_imm_b8_checked(
&mut self,
new_val: <B8 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_imm_b8_checked( &mut self, new_val: <B8 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of imm_b8 to the given value.
#Errors
If the given value is out of bounds for imm_b8.
Sourcepub fn funct3_or_err(
&self,
) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 as Specifier>::Bytes>>
pub fn funct3_or_err( &self, ) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 as Specifier>::Bytes>>
Returns the value of funct3.
#Errors
If the returned value contains an invalid bit pattern for funct3.
Sourcepub fn with_funct3(self, new_val: <B3 as Specifier>::InOut) -> Self
pub fn with_funct3(self, new_val: <B3 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of funct3 set to the given value.
#Panics
If the given value is out of bounds for funct3.
Sourcepub fn with_funct3_checked(
self,
new_val: <B3 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_funct3_checked( self, new_val: <B3 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of funct3 set to the given value.
#Errors
If the given value is out of bounds for funct3.
Sourcepub fn set_funct3(&mut self, new_val: <B3 as Specifier>::InOut)
pub fn set_funct3(&mut self, new_val: <B3 as Specifier>::InOut)
Sets the value of funct3 to the given value.
#Panics
If the given value is out of bounds for funct3.
Sourcepub fn set_funct3_checked(
&mut self,
new_val: <B3 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_funct3_checked( &mut self, new_val: <B3 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of funct3 to the given value.
#Errors
If the given value is out of bounds for funct3.