Trait yaxpeax_arch::AddressBase
source · [−]pub trait AddressBasewhere
Self: AddressDisplay + Copy + Clone + Sized + Hash + Ord + Eq + PartialEq + Bounded + Add<AddressDiff<Self>, Output = Self> + Sub<AddressDiff<Self>, Output = Self> + AddAssign<AddressDiff<Self>> + SubAssign<AddressDiff<Self>> + Zero,{
type Diff: AddressDiffAmount;
fn to_linear(&self) -> usize;
fn diff(&self, other: &Self) -> Option<AddressDiff<Self>>;
fn wrapping_offset(&self, other: AddressDiff<Self>) -> Self;
fn checked_offset(&self, other: AddressDiff<Self>) -> Option<Self>;
}
Required Associated Types
type Diff: AddressDiffAmount
Required Methods
fn to_linear(&self) -> usize
sourcefn diff(&self, other: &Self) -> Option<AddressDiff<Self>>
fn diff(&self, other: &Self) -> Option<AddressDiff<Self>>
compute the AddressDiff
beetween self
and other
.
may return None
if the two addresses aren’t comparable. for example, if a pair of
addresses are a data-space address and code-space address, there may be no scalar that can
describe the difference between them.