Trait yaxpeax_arch::Decoder

source ·
pub trait Decoder<A: Arch + ?Sized> {
    // Required method
    fn decode_into<T: Reader<A::Address, A::Word>>(
        &self,
        inst: &mut A::Instruction,
        words: &mut T
    ) -> Result<(), A::DecodeError>;

    // Provided method
    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§

source

fn decode_into<T: Reader<A::Address, A::Word>>( &self, inst: &mut A::Instruction, words: &mut T ) -> Result<(), A::DecodeError>

decode one instruction for this architecture from the crate::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§

source

fn decode<T: Reader<A::Address, A::Word>>( &self, words: &mut T ) -> Result<A::Instruction, A::DecodeError>

decode one instruction for this architecture from the crate::Reader of this architecture’s Word.

Object Safety§

This trait is not object safe.

Implementors§