aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index edc0742..7aaba21 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
#![no_std]
+#![doc = include_str!("../README.md")]
use core::fmt::{self, Debug, Display};
use core::hash::Hash;
@@ -15,6 +16,8 @@ pub use address::{AddressDisplayUsize, AddressDisplayU64, AddressDisplayU32, Add
#[cfg(feature="address-parse")]
pub use address::AddrParse;
+pub mod annotation;
+
mod color;
pub use color::{Colorize, NoColors, YaxColors};
@@ -124,17 +127,26 @@ impl DecodeError for StandardPartialDecoderError {
}
}
+#[derive(Copy, Clone)]
+struct NoDescription {}
+
+impl fmt::Display for NoDescription {
+ fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+ Ok(())
+ }
+}
+
/// an interface to decode [`Arch::Instruction`] words from a reader of [`Arch::Word`]s. errors are
/// the architecture-defined [`DecodeError`] implemention.
pub trait Decoder<A: Arch + ?Sized> {
- /// decode one instruction for this architecture from the [`yaxpeax_arch::Reader`] of this
+ /// decode one instruction for this architecture from the [`crate::Reader`] of this
/// architecture's `Word`.
fn decode<T: Reader<A::Address, A::Word>>(&self, words: &mut T) -> Result<A::Instruction, A::DecodeError> {
let mut inst = A::Instruction::default();
self.decode_into(&mut inst, words).map(|_: ()| inst)
}
- /// decode one instruction for this architecture from the [`yaxpeax_arch::Reader`] of this
+ /// decode one instruction for this architecture from the [`crate::Reader`] of this
/// architecture's `Word`, writing into the provided `inst`.
///
/// SAFETY: