pub struct SType { /* private fields */ }Implementations§
Source§impl SType
impl SType
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 SType
impl SType
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 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 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.
Sourcepub fn rs1_or_err(
&self,
) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
pub fn rs1_or_err( &self, ) -> Result<<B5 as Specifier>::InOut, InvalidBitPattern<<B5 as Specifier>::Bytes>>
Returns the value of rs1.
#Errors
If the returned value contains an invalid bit pattern for rs1.
Sourcepub fn with_rs1(self, new_val: <B5 as Specifier>::InOut) -> Self
pub fn with_rs1(self, new_val: <B5 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of rs1 set to the given value.
#Panics
If the given value is out of bounds for rs1.
Sourcepub fn with_rs1_checked(
self,
new_val: <B5 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_rs1_checked( self, new_val: <B5 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of rs1 set to the given value.
#Errors
If the given value is out of bounds for rs1.
Sourcepub fn set_rs1(&mut self, new_val: <B5 as Specifier>::InOut)
pub fn set_rs1(&mut self, new_val: <B5 as Specifier>::InOut)
Sets the value of rs1 to the given value.
#Panics
If the given value is out of bounds for rs1.
Sourcepub fn set_rs1_checked(
&mut self,
new_val: <B5 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_rs1_checked( &mut self, new_val: <B5 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of rs1 to the given value.
#Errors
If the given value is out of bounds for rs1.
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 imm11_5_or_err(
&self,
) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
pub fn imm11_5_or_err( &self, ) -> Result<<B7 as Specifier>::InOut, InvalidBitPattern<<B7 as Specifier>::Bytes>>
Returns the value of imm11_5.
#Errors
If the returned value contains an invalid bit pattern for imm11_5.
Sourcepub fn with_imm11_5(self, new_val: <B7 as Specifier>::InOut) -> Self
pub fn with_imm11_5(self, new_val: <B7 as Specifier>::InOut) -> Self
Returns a copy of the bitfield with the value of imm11_5 set to the given value.
#Panics
If the given value is out of bounds for imm11_5.
Sourcepub fn with_imm11_5_checked(
self,
new_val: <B7 as Specifier>::InOut,
) -> Result<Self, OutOfBounds>
pub fn with_imm11_5_checked( self, new_val: <B7 as Specifier>::InOut, ) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of imm11_5 set to the given value.
#Errors
If the given value is out of bounds for imm11_5.
Sourcepub fn set_imm11_5(&mut self, new_val: <B7 as Specifier>::InOut)
pub fn set_imm11_5(&mut self, new_val: <B7 as Specifier>::InOut)
Sets the value of imm11_5 to the given value.
#Panics
If the given value is out of bounds for imm11_5.
Sourcepub fn set_imm11_5_checked(
&mut self,
new_val: <B7 as Specifier>::InOut,
) -> Result<(), OutOfBounds>
pub fn set_imm11_5_checked( &mut self, new_val: <B7 as Specifier>::InOut, ) -> Result<(), OutOfBounds>
Sets the value of imm11_5 to the given value.
#Errors
If the given value is out of bounds for imm11_5.