Struct svmap::MemoryRegion
source · pub struct MemoryRegion<D: Clone> { /* private fields */ }
Expand description
Describes a region in memory.
The MemoryRegion.upper_bound
is inclusive.
Biggest possible memory address: AddressType::MAX
.
Implementations§
source§impl<D: Clone> MemoryRegion<D>
impl<D: Clone> MemoryRegion<D>
sourcepub fn address_in_region(&self, address: AddressType) -> bool
pub fn address_in_region(&self, address: AddressType) -> bool
Returns true
if a address is inside of the MemoryRegion
.
sourcepub fn address_comes_after(&self, address: AddressType) -> bool
pub fn address_comes_after(&self, address: AddressType) -> bool
Returns true
if a address comes after the upper bound of the MemoryRegion
.
sourcepub fn overlaps(&self, other: &MemoryRegion<D>) -> bool
pub fn overlaps(&self, other: &MemoryRegion<D>) -> bool
Returns true
if the given MemoryRegion
overlaps with another MemoryRegion
.
sourcepub fn comes_after(&self, other: &MemoryRegion<D>) -> bool
pub fn comes_after(&self, other: &MemoryRegion<D>) -> bool
Returns true
if the given MemoryRegion
s lower bound is bigger than the other
MemoryRegion
s upper bound.
sourcepub fn starts_at_zero(&self) -> bool
pub fn starts_at_zero(&self) -> bool
Returns true
if the MemoryRegion
starts at the beginning of memory.
sourcepub fn is_adjacent_to(&self, other: &MemoryRegion<D>) -> bool
pub fn is_adjacent_to(&self, other: &MemoryRegion<D>) -> bool
Returns true
if the given MemoryRegion
is directly next to another MemoryRegion
.
sourcepub fn lower_bound(&self) -> AddressType
pub fn lower_bound(&self) -> AddressType
Lower bound of the MemoryRegion
.
sourcepub fn upper_bound(&self) -> AddressType
pub fn upper_bound(&self) -> AddressType
Upper bound of the MemoryRegion
.
sourcepub fn description(&self) -> D
pub fn description(&self) -> D
Description of the MemoryRegion
.
sourcepub fn to_range(&self) -> RangeInclusive<AddressType>
pub fn to_range(&self) -> RangeInclusive<AddressType>
Returns the MemoryRegion
as a range.
Trait Implementations§
source§impl<D: PartialEq + Clone> PartialEq<MemoryRegion<D>> for MemoryRegion<D>
impl<D: PartialEq + Clone> PartialEq<MemoryRegion<D>> for MemoryRegion<D>
source§fn eq(&self, other: &MemoryRegion<D>) -> bool
fn eq(&self, other: &MemoryRegion<D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<D: Eq + Clone> Eq for MemoryRegion<D>
impl<D: Clone> StructuralEq for MemoryRegion<D>
impl<D: Clone> StructuralPartialEq for MemoryRegion<D>
Auto Trait Implementations§
impl<D> RefUnwindSafe for MemoryRegion<D>where D: RefUnwindSafe,
impl<D> Send for MemoryRegion<D>where D: Send,
impl<D> Sync for MemoryRegion<D>where D: Sync,
impl<D> Unpin for MemoryRegion<D>where D: Unpin,
impl<D> UnwindSafe for MemoryRegion<D>where D: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more