Trait yaxpeax_arch::DecodeError[][src]

pub trait DecodeError: PartialEq + Display + Debug + Send + Sync + 'static {
    fn data_exhausted(&self) -> bool;
fn bad_opcode(&self) -> bool;
fn bad_operand(&self) -> bool;
fn description(&self) -> &'static str; }
Expand description

the minimum set of errors a yaxpeax-arch disassembler may produce.

it is permissible for an implementor of DecodeError to have items that return false for all these functions; decoders are permitted to error in way that yaxpeax-arch does not know about.

Required methods

did the decoder fail because it reached the end of input?

did the decoder error because the instruction’s opcode is invalid?

this may not be a sensical question for some instruction sets - bad_opcode should generally indicate an issue with the instruction itself. this is in contrast to one specific operand being invalid for the instruction, or some other issue to do with decoding data beyond the top-level instruction. the “opcode”/“operand” distinction is often fuzzy and left as best-effort for decoder implementors.

did the decoder error because an operand of the instruction to decode is invalid?

similar to DecodeError::bad_opcode, this is a subjective distinction and best-effort on the part of implementors.

a human-friendly description of this decode error.

Implementors