#[non_exhaustive]pub enum Instr<Extension = NOp>where
Extension: InstructionSet,{
ControlFlow(ControlFlowOp),
Put(PutOp),
Move(MoveOp),
Cmp(CmpOp),
Arithmetic(ArithmeticOp),
Bitwise(BitwiseOp),
Bytes(BytesOp),
Digest(DigestOp),
ExtensionCodes(Extension),
Nop,
}Expand description
Full set of instructions
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ControlFlow(ControlFlowOp)
Control-flow instructions
Put(PutOp)
Instructions setting register values
Move(MoveOp)
Instructions moving and swapping register values
Cmp(CmpOp)
Instructions comparing register values
Arithmetic(ArithmeticOp)
Arithmetic instructions
Bitwise(BitwiseOp)
Bit operations & boolean algebra instructions
Bytes(BytesOp)
Operations on byte strings
Digest(DigestOp)
Cryptographic hashing functions
ExtensionCodes(Extension)
Extension operations which can be provided by a host environment
Nop
No-operation instruction
Trait Implementations§
Source§impl<Extension> Bytecode for Instr<Extension>where
Extension: InstructionSet,
impl<Extension> Bytecode for Instr<Extension>where
Extension: InstructionSet,
Source§fn byte_count(&self) -> u16
fn byte_count(&self) -> u16
Returns number of bytes which instruction and its argument occupies
Source§fn instr_range() -> RangeInclusive<u8>
fn instr_range() -> RangeInclusive<u8>
Returns range of instruction btecodes covered by a set of operations
Source§fn instr_byte(&self) -> u8
fn instr_byte(&self) -> u8
Returns byte representing instruction code (without its arguments)
Source§fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError>where
W: Write,
EncodeError: From<<W as Write>::Error>,
fn write_args<W>(&self, writer: &mut W) -> Result<(), EncodeError>where
W: Write,
EncodeError: From<<W as Write>::Error>,
Writes instruction arguments as bytecode, omitting instruction code byte
Source§fn read<R>(reader: &mut R) -> Result<Self, DecodeError>where
R: Read,
DecodeError: From<<R as Read>::Error>,
fn read<R>(reader: &mut R) -> Result<Self, DecodeError>where
R: Read,
DecodeError: From<<R as Read>::Error>,
Reads the instruction from bytecode
Source§fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError>where
W: Write,
EncodeError: From<<W as Write>::Error>,
fn write<W>(&self, writer: &mut W) -> Result<(), EncodeError>where
W: Write,
EncodeError: From<<W as Write>::Error>,
Writes the instruction as bytecode
Source§impl<Extension> Display for Instr<Extension>where
Extension: InstructionSet,
impl<Extension> Display for Instr<Extension>where
Extension: InstructionSet,
Source§impl<Extension> InstructionSet for Instr<Extension>where
Extension: InstructionSet,
impl<Extension> InstructionSet for Instr<Extension>where
Extension: InstructionSet,
impl<Extension> Eq for Instr<Extension>where
Extension: InstructionSet + Eq,
impl<Extension> StructuralPartialEq for Instr<Extension>where
Extension: InstructionSet,
Auto Trait Implementations§
impl<Extension> Freeze for Instr<Extension>where
Extension: Freeze,
impl<Extension> RefUnwindSafe for Instr<Extension>where
Extension: RefUnwindSafe,
impl<Extension> Send for Instr<Extension>where
Extension: Send,
impl<Extension> Sync for Instr<Extension>where
Extension: Sync,
impl<Extension> Unpin for Instr<Extension>where
Extension: Unpin,
impl<Extension> UnwindSafe for Instr<Extension>where
Extension: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more