Instruction

Trait Instruction 

Source
pub trait Instruction:
    Copy
    + Clone
    + Debug
    + Display {
    // Required methods
    fn value(&self) -> u64;
    fn bytes(&self) -> Vec<u8> ;
    fn size(&self) -> usize;
}
Expand description

A machine instruction that can be encoded to bytes

Required Methods§

Source

fn value(&self) -> u64

Get the instruction as a 32-bit or 64-bit value

Source

fn bytes(&self) -> Vec<u8>

Get the instruction as bytes (little-endian)

Source

fn size(&self) -> usize

Get the size of this instruction in bytes

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Instruction for jit_assembler::riscv64::instruction::Instruction

Source§

impl Instruction for jit_assembler::aarch64::instruction::Instruction