yaxpeax_arch

Trait LengthedInstruction

Source
pub trait LengthedInstruction {
    type Unit;

    // Required methods
    fn len(&self) -> Self::Unit;
    fn min_size() -> Self::Unit;
}
Expand description

instructions have lengths, and minimum possible sizes for advancing a decoder on error.

unfortunately, this means calling x.len() for some Arch::Instruction requires importing this trait. sorry.

Required Associated Types§

Required Methods§

Source

fn len(&self) -> Self::Unit

the length, in terms of Unit, of this instruction. because Unit will be a diff of an architecture’s Address type, this almost always is a number of bytes. implementations should indicate if this is ever not the case.

Source

fn min_size() -> Self::Unit

the length, in terms of Unit, of the shortest possible instruction in a given architecture.. because Unit will be a diff of an architecture’s Address type, this almost always is a number of bytes. implementations should indicate if this is ever not the case.

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§