Trait yaxpeax_arch::DecodeError
source · [−]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
sourcefn data_exhausted(&self) -> bool
fn data_exhausted(&self) -> bool
did the decoder fail because it reached the end of input?
sourcefn bad_opcode(&self) -> bool
fn bad_opcode(&self) -> bool
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.
sourcefn bad_operand(&self) -> bool
fn bad_operand(&self) -> bool
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.
sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
a human-friendly description of this decode error.