pub struct CBIType { /* private fields */ }Implementations§
Source§impl CBIType
impl CBIType
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 CBIType
impl CBIType
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 imm4_0_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn imm4_0_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of imm4_0.
#Errors
If the returned value contains an invalid bit pattern for imm4_0.
Sourcepub fn with_imm4_0(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_imm4_0(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of imm4_0 set to the given value.
#Panics
If the given value is out of bounds for imm4_0.
Sourcepub fn with_imm4_0_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_imm4_0_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of imm4_0 set to the given value.
#Errors
If the given value is out of bounds for imm4_0.
Sourcepub fn set_imm4_0(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_imm4_0(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of imm4_0 to the given value.
#Panics
If the given value is out of bounds for imm4_0.
Sourcepub fn set_imm4_0_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_imm4_0_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of imm4_0 to the given value.
#Errors
If the given value is out of bounds for imm4_0.
Sourcepub fn rd_or_rs1_or_err(
&self,
) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 as Specifier>::Bytes>>
pub fn rd_or_rs1_or_err( &self, ) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 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: <B3 as Specifier>::InOut) -> Self
pub fn with_rd_or_rs1(self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rd_or_rs1_checked( self, new_val: <B3 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: <B3 as Specifier>::InOut)
pub fn set_rd_or_rs1(&mut self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rd_or_rs1_checked( &mut self, new_val: <B3 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 funct2_or_err(
&self,
) -> Result<<B2 as Specifier>::InOut, InvalidBitPattern<<B2 as Specifier>::Bytes>>
pub fn funct2_or_err( &self, ) -> Result<<B2 as Specifier>::InOut, InvalidBitPattern<<B2 as Specifier>::Bytes>>
Returns the value of funct2.
#Errors
If the returned value contains an invalid bit pattern for funct2.
Sourcepub fn with_funct2(self, new_val: <B2 as Specifier>::InOut) -> Self
pub fn with_funct2(self, new_val: <B2 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of funct2 set to the given value.
#Panics
If the given value is out of bounds for funct2.
Sourcepub fn with_funct2_checked(
self,
new_val: <B2 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_funct2_checked( self, new_val: <B2 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of funct2 set to the given value.
#Errors
If the given value is out of bounds for funct2.
Sourcepub fn set_funct2(&mut self, new_val: <B2 as Specifier>::InOut)
pub fn set_funct2(&mut self, new_val: <B2 as Specifier>::InOut)
Sets the value of funct2 to the given value.
#Panics
If the given value is out of bounds for funct2.
Sourcepub fn set_funct2_checked(
&mut self,
new_val: <B2 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_funct2_checked( &mut self, new_val: <B2 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of funct2 to the given value.
#Errors
If the given value is out of bounds for funct2.
Sourcepub fn imm5_or_err(
&self,
) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
pub fn imm5_or_err( &self, ) -> Result<<B1 as Specifier>::InOut, InvalidBitPattern<<B1 as Specifier>::Bytes>>
Returns the value of imm5.
#Errors
If the returned value contains an invalid bit pattern for imm5.
Sourcepub fn with_imm5(self, new_val: <B1 as Specifier>::InOut) -> Self
pub fn with_imm5(self, new_val: <B1 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of imm5 set to the given value.
#Panics
If the given value is out of bounds for imm5.
Sourcepub fn with_imm5_checked(
self,
new_val: <B1 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_imm5_checked( self, new_val: <B1 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of imm5 set to the given value.
#Errors
If the given value is out of bounds for imm5.
Sourcepub fn set_imm5(&mut self, new_val: <B1 as Specifier>::InOut)
pub fn set_imm5(&mut self, new_val: <B1 as Specifier>::InOut)
Sets the value of imm5 to the given value.
#Panics
If the given value is out of bounds for imm5.
Sourcepub fn set_imm5_checked(
&mut self,
new_val: <B1 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_imm5_checked( &mut self, new_val: <B1 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of imm5 to the given value.
#Errors
If the given value is out of bounds for imm5.
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.