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§
impl<D: Eq + Clone> Eq for MemoryRegion<D>
impl<D: Clone> StructuralPartialEq for MemoryRegion<D>
Auto Trait Implementations§
impl<D> Freeze for MemoryRegion<D>where
D: Freeze,
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