Trait yaxpeax_arch::Decoder[][src]

pub trait Decoder<A: Arch + ?Sized> {
    fn decode_into<T: Reader<A::Address, A::Word>>(
        &self,
        inst: &mut A::Instruction,
        words: &mut T
    ) -> Result<(), A::DecodeError>; fn decode<T: Reader<A::Address, A::Word>>(
        &self,
        words: &mut T
    ) -> Result<A::Instruction, A::DecodeError> { ... } }
Expand description

an interface to decode Arch::Instruction words from a reader of Arch::Words. errors are the architecture-defined DecodeError implemention.

Required methods

decode one instruction for this architecture from the [yaxpeax_arch::Reader] of this architecture’s Word, writing into the provided inst.

SAFETY:

while inst MUST be left in a state that does not violate Rust’s safety guarantees, implementors are NOT obligated to leave inst in a semantically meaningful state if decoding fails. if decode_into returns an error, callers may find contradictory and useless information in inst, as well as stale data from whatever was passed in.

Provided methods

decode one instruction for this architecture from the [yaxpeax_arch::Reader] of this architecture’s Word.

Implementors