Crate yaxpeax_arch[−][src]
Modules
Structs
a struct describing the differece between some pair of A: Address
. this is primarily useful
in describing the size of an instruction, or the relative offset of a branch.
a struct for Reader
impls that can operate on units of u8
.
Enums
a minimal enum implementing DecodeError
. this is intended to be enough for a low effort,
low-fidelity error taxonomy, without boilerplate of a DecodeError
implementation.
a slightly less minimal enum DecodeError
. similar to StandardDecodeError
, this is an
anti-boilerplate measure. it additionally provides IncompleteDecoder
, making it suitable to
represent error kinds for decoders that are … not yet complete.
Traits
an interface to decode Arch::Instruction
words from a reader of Arch::Word
s, with the
decoder able to report descriptions of bits or fields in the instruction to a sink implementing
DescriptionSink
. the sink may be NullSink
which discards provided data. decoding with a
NullSink
should behave identically to Decoder::decode_into
. implementors are recommended to
implement Decoder::decode_into
as a call to AnnotatingDecoder::decode_with_fields
if
implementing both traits.
a collection of associated type parameters that constitute the definitions for an instruction
set. Arch
provides an Instruction
and its associated Operand
s, which is guaranteed to be
decodable by this Arch::Decoder
. Arch::Decoder
can always be constructed with a Default
implementation, and decodes from a Reader<Arch::Address, Arch::Word>
.
the minimum set of errors a yaxpeax-arch
disassembler may produce.
this is not a particularly interesting trait. it just exists to add a std::error::Error
bound onto DecodeError
for std
builds.
an interface to decode Arch::Instruction
words from a reader of Arch::Word
s. errors are
the architecture-defined DecodeError
implemention.
implementors of DescriptionSink
receive descriptions of an instruction’s disassembly process
and relevant offsets in the bitstream being decoded. descriptions are archtecture-specific, and
architectures are expected to be able to turn the bit-level start
and width
values into a
meaningful description of bits in the original instruction stream.
instructions have lengths, and minimum possible sizes for advancing a decoder on error.
a trait defining how Item
-sized words are read at Address
-positioned offsets into some
stream of data. for most uses, [yaxpeax_arch::U8Reader
] probably is sufficient. when
reading from data sources that aren’t &[u8]
, Address
isn’t a multiple of u8
, or Item
isn’t a multiple of 8 bits, U8Reader
won’t be sufficient.
a trait defining how to build a Reader<Address, Item>
from some data source (Self
).
definitions of ReaderBuilder
are provided for U8Reader
on Address
and Word
types that
yaxpeax_arch
provides - external decoder implementations should also provide ReaderBuilder
impls if they use custom Reader
types.