Struct yaxpeax_arch::AddressDiff
source · [−]pub struct AddressDiff<T: AddressBase> { /* private fields */ }
Expand description
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.
for any address type A
, the following must hold:
use yaxpeax_arch::AddressBase;
fn diff_check<A: AddressBase + core::fmt::Debug>(left: A, right: A) {
let diff = left.diff(&right);
if let Some(offset) = diff {
assert_eq!(left.wrapping_offset(offset), right);
}
}
which is to say, yaxpeax
assumes associativity holds when diff
yields a Some
.
Implementations
sourceimpl<T: Address> AddressDiff<T>
impl<T: Address> AddressDiff<T>
Trait Implementations
sourceimpl Add<AddressDiff<u16>> for u16
impl Add<AddressDiff<u16>> for u16
sourceimpl Add<AddressDiff<u32>> for u32
impl Add<AddressDiff<u32>> for u32
sourceimpl Add<AddressDiff<u64>> for u64
impl Add<AddressDiff<u64>> for u64
sourceimpl Add<AddressDiff<usize>> for usize
impl Add<AddressDiff<usize>> for usize
sourceimpl AddAssign<AddressDiff<u16>> for u16
impl AddAssign<AddressDiff<u16>> for u16
sourcefn add_assign(&mut self, other: AddressDiff<Self>)
fn add_assign(&mut self, other: AddressDiff<Self>)
Performs the
+=
operation. Read moresourceimpl AddAssign<AddressDiff<u32>> for u32
impl AddAssign<AddressDiff<u32>> for u32
sourcefn add_assign(&mut self, other: AddressDiff<Self>)
fn add_assign(&mut self, other: AddressDiff<Self>)
Performs the
+=
operation. Read moresourceimpl AddAssign<AddressDiff<u64>> for u64
impl AddAssign<AddressDiff<u64>> for u64
sourcefn add_assign(&mut self, other: AddressDiff<Self>)
fn add_assign(&mut self, other: AddressDiff<Self>)
Performs the
+=
operation. Read moresourceimpl AddAssign<AddressDiff<usize>> for usize
impl AddAssign<AddressDiff<usize>> for usize
sourcefn add_assign(&mut self, other: AddressDiff<Self>)
fn add_assign(&mut self, other: AddressDiff<Self>)
Performs the
+=
operation. Read moresourceimpl<T: Clone + AddressBase> Clone for AddressDiff<T>where
T::Diff: Clone,
impl<T: Clone + AddressBase> Clone for AddressDiff<T>where
T::Diff: Clone,
sourcefn clone(&self) -> AddressDiff<T>
fn clone(&self) -> AddressDiff<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<T: Ord + AddressBase> Ord for AddressDiff<T>where
T::Diff: Ord,
impl<T: Ord + AddressBase> Ord for AddressDiff<T>where
T::Diff: Ord,
sourcefn cmp(&self, other: &AddressDiff<T>) -> Ordering
fn cmp(&self, other: &AddressDiff<T>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq + AddressBase> PartialEq<AddressDiff<T>> for AddressDiff<T>where
T::Diff: PartialEq,
impl<T: PartialEq + AddressBase> PartialEq<AddressDiff<T>> for AddressDiff<T>where
T::Diff: PartialEq,
sourcefn eq(&self, other: &AddressDiff<T>) -> bool
fn eq(&self, other: &AddressDiff<T>) -> bool
sourceimpl<T: PartialOrd + AddressBase> PartialOrd<AddressDiff<T>> for AddressDiff<T>where
T::Diff: PartialOrd,
impl<T: PartialOrd + AddressBase> PartialOrd<AddressDiff<T>> for AddressDiff<T>where
T::Diff: PartialOrd,
sourcefn partial_cmp(&self, other: &AddressDiff<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressDiff<T>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Sub<AddressDiff<u16>> for u16
impl Sub<AddressDiff<u16>> for u16
sourceimpl Sub<AddressDiff<u32>> for u32
impl Sub<AddressDiff<u32>> for u32
sourceimpl Sub<AddressDiff<u64>> for u64
impl Sub<AddressDiff<u64>> for u64
sourceimpl Sub<AddressDiff<usize>> for usize
impl Sub<AddressDiff<usize>> for usize
sourceimpl SubAssign<AddressDiff<u16>> for u16
impl SubAssign<AddressDiff<u16>> for u16
sourcefn sub_assign(&mut self, other: AddressDiff<Self>)
fn sub_assign(&mut self, other: AddressDiff<Self>)
Performs the
-=
operation. Read moresourceimpl SubAssign<AddressDiff<u32>> for u32
impl SubAssign<AddressDiff<u32>> for u32
sourcefn sub_assign(&mut self, other: AddressDiff<Self>)
fn sub_assign(&mut self, other: AddressDiff<Self>)
Performs the
-=
operation. Read moresourceimpl SubAssign<AddressDiff<u64>> for u64
impl SubAssign<AddressDiff<u64>> for u64
sourcefn sub_assign(&mut self, other: AddressDiff<Self>)
fn sub_assign(&mut self, other: AddressDiff<Self>)
Performs the
-=
operation. Read moresourceimpl SubAssign<AddressDiff<usize>> for usize
impl SubAssign<AddressDiff<usize>> for usize
sourcefn sub_assign(&mut self, other: AddressDiff<Self>)
fn sub_assign(&mut self, other: AddressDiff<Self>)
Performs the
-=
operation. Read moreimpl<T: Copy + AddressBase> Copy for AddressDiff<T>where
T::Diff: Copy,
impl<T: Eq + AddressBase> Eq for AddressDiff<T>where
T::Diff: Eq,
impl<T: AddressBase> StructuralEq for AddressDiff<T>
impl<T: AddressBase> StructuralPartialEq for AddressDiff<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for AddressDiff<T>where
<T as AddressBase>::Diff: RefUnwindSafe,
impl<T> Send for AddressDiff<T>where
<T as AddressBase>::Diff: Send,
impl<T> Sync for AddressDiff<T>where
<T as AddressBase>::Diff: Sync,
impl<T> Unpin for AddressDiff<T>where
<T as AddressBase>::Diff: Unpin,
impl<T> UnwindSafe for AddressDiff<T>where
<T as AddressBase>::Diff: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more