pub struct CAType { /* private fields */ }Implementations§
Source§impl CAType
impl CAType
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 CAType
impl CAType
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<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 as Specifier>::Bytes>>
pub fn rs2_or_err( &self, ) -> Result<<B3 as Specifier>::InOut, InvalidBitPattern<<B3 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: <B3 as Specifier>::InOut) -> Self
pub fn with_rs2(self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rs2_checked( self, new_val: <B3 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: <B3 as Specifier>::InOut)
pub fn set_rs2(&mut self, new_val: <B3 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: <B3 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rs2_checked( &mut self, new_val: <B3 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 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 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 funct6_or_err(
&self,
) -> Result<<B6 as Specifier>::InOut, InvalidBitPattern<<B6 as Specifier>::Bytes>>
pub fn funct6_or_err( &self, ) -> Result<<B6 as Specifier>::InOut, InvalidBitPattern<<B6 as Specifier>::Bytes>>
Returns the value of funct6.
#Errors
If the returned value contains an invalid bit pattern for funct6.
Sourcepub fn with_funct6(self, new_val: <B6 as Specifier>::InOut) -> Self
pub fn with_funct6(self, new_val: <B6 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of funct6 set to the given value.
#Panics
If the given value is out of bounds for funct6.
Sourcepub fn with_funct6_checked(
self,
new_val: <B6 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_funct6_checked( self, new_val: <B6 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of funct6 set to the given value.
#Errors
If the given value is out of bounds for funct6.
Sourcepub fn set_funct6(&mut self, new_val: <B6 as Specifier>::InOut)
pub fn set_funct6(&mut self, new_val: <B6 as Specifier>::InOut)
Sets the value of funct6 to the given value.
#Panics
If the given value is out of bounds for funct6.
Sourcepub fn set_funct6_checked(
&mut self,
new_val: <B6 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_funct6_checked( &mut self, new_val: <B6 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of funct6 to the given value.
#Errors
If the given value is out of bounds for funct6.