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>

source

pub fn address_in_region(&self, address: AddressType) -> bool

Returns true if a address is inside of the MemoryRegion.

source

pub fn address_comes_after(&self, address: AddressType) -> bool

Returns true if a address comes after the upper bound of the MemoryRegion.

source

pub fn overlaps(&self, other: &MemoryRegion<D>) -> bool

Returns true if the given MemoryRegion overlaps with another MemoryRegion.

source

pub fn comes_after(&self, other: &MemoryRegion<D>) -> bool

Returns true if the given MemoryRegions lower bound is bigger than the other MemoryRegions upper bound.

source

pub fn starts_at_zero(&self) -> bool

Returns true if the MemoryRegion starts at the beginning of memory.

source

pub fn is_adjacent_to(&self, other: &MemoryRegion<D>) -> bool

Returns true if the given MemoryRegion is directly next to another MemoryRegion.

source

pub fn lower_bound(&self) -> AddressType

Lower bound of the MemoryRegion.

source

pub fn upper_bound(&self) -> AddressType

Upper bound of the MemoryRegion.

source

pub fn description(&self) -> D

Description of the MemoryRegion.

source

pub fn to_range(&self) -> RangeInclusive<AddressType>

Returns the MemoryRegion as a range.

Trait Implementations§

source§

impl<D: Debug + Clone> Debug for MemoryRegion<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: PartialEq + Clone> PartialEq<MemoryRegion<D>> for MemoryRegion<D>

source§

fn eq(&self, other: &MemoryRegion<D>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<D: Eq + Clone> Eq for MemoryRegion<D>

source§

impl<D: Clone> StructuralEq for MemoryRegion<D>

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.