pub struct CRType { /* private fields */ }Implementations§
Source§impl CRType
impl CRType
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 CRType
impl CRType
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 rs2_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn rs2_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of rs2.
#Errors
If the returned value contains an invalid bit pattern for rs2.
Sourcepub fn with_rs2(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_rs2(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of rs2 set to the given value.
#Panics
If the given value is out of bounds for rs2.
Sourcepub fn with_rs2_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rs2_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of rs2 set to the given value.
#Errors
If the given value is out of bounds for rs2.
Sourcepub fn set_rs2(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_rs2(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of rs2 to the given value.
#Panics
If the given value is out of bounds for rs2.
Sourcepub fn set_rs2_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rs2_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of rs2 to the given value.
#Errors
If the given value is out of bounds for rs2.
Sourcepub fn rd_or_rs1_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn rd_or_rs1_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of rd_or_rs1.
#Errors
If the returned value contains an invalid bit pattern for rd_or_rs1.
Sourcepub fn with_rd_or_rs1(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_rd_or_rs1(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of rd_or_rs1 set to the given value.
#Panics
If the given value is out of bounds for rd_or_rs1.
Sourcepub fn with_rd_or_rs1_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rd_or_rs1_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of rd_or_rs1 set to the given value.
#Errors
If the given value is out of bounds for rd_or_rs1.
Sourcepub fn set_rd_or_rs1(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_rd_or_rs1(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of rd_or_rs1 to the given value.
#Panics
If the given value is out of bounds for rd_or_rs1.
Sourcepub fn set_rd_or_rs1_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rd_or_rs1_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of rd_or_rs1 to the given value.
#Errors
If the given value is out of bounds for rd_or_rs1.
Sourcepub fn funct4_or_err(
&self,
) -> Result<<B4 as Specifier>::InOut, InvalidBitPattern<<B4 as Specifier>::Bytes>>
pub fn funct4_or_err( &self, ) -> Result<<B4 as Specifier>::InOut, InvalidBitPattern<<B4 as Specifier>::Bytes>>
Returns the value of funct4.
#Errors
If the returned value contains an invalid bit pattern for funct4.
Sourcepub fn with_funct4(self, new_val: <B4 as Specifier>::InOut) -> Self
pub fn with_funct4(self, new_val: <B4 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of funct4 set to the given value.
#Panics
If the given value is out of bounds for funct4.
Sourcepub fn with_funct4_checked(
self,
new_val: <B4 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_funct4_checked( self, new_val: <B4 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of funct4 set to the given value.
#Errors
If the given value is out of bounds for funct4.
Sourcepub fn set_funct4(&mut self, new_val: <B4 as Specifier>::InOut)
pub fn set_funct4(&mut self, new_val: <B4 as Specifier>::InOut)
Sets the value of funct4 to the given value.
#Panics
If the given value is out of bounds for funct4.
Sourcepub fn set_funct4_checked(
&mut self,
new_val: <B4 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_funct4_checked( &mut self, new_val: <B4 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of funct4 to the given value.
#Errors
If the given value is out of bounds for funct4.