Struct Area
pub struct Area { /* private fields */ }
Expand description
Represents an arbitrary memory area between two Addrs.
Note that there are several edge-cases around wrapping.
For example, Area::first_address_after
may return a number smaller than Area::start_addr
if the area wraps around.
The functions implemented on Area
take these edge-cases into account.
Implementations§
§impl Area
impl Area
pub fn start_addr(&self) -> Addr
pub fn start_addr(&self) -> Addr
Returns the start address of the area
pub fn first_address_after(&self) -> Addr
pub fn first_address_after(&self) -> Addr
Returns the first address after the area. May be smaller than the start address if the area wraps around.
pub fn extend_before(&self, size: u64) -> Area
pub fn extend_before(&self, size: u64) -> Area
Extends the start of the address by size
bytes.
pub fn crosses_page_bounds(&self, page_bits: usize) -> bool
pub fn crosses_page_bounds(&self, page_bits: usize) -> bool
Returns true if the page of the first address in the area and the page of the last address in the area are different.
Returns true if the areas have at least one page which is shared by both.
pub fn overlaps_with(&self, other: &Area) -> bool
pub fn overlaps_with(&self, other: &Area) -> bool
Returns true if the area overlaps with other
.
Trait Implementations§
impl Copy for Area
impl Eq for Area
impl StructuralPartialEq for Area
Auto Trait Implementations§
impl Freeze for Area
impl RefUnwindSafe for Area
impl Send for Area
impl Sync for Area
impl Unpin for Area
impl UnwindSafe for Area
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more