Struct memory_addr::PhysAddr
source · pub struct PhysAddr(/* private fields */);
Expand description
A physical memory address.
It’s a wrapper type around an usize
.
Implementations§
source§impl PhysAddr
impl PhysAddr
sourcepub fn align_down<U>(self, align: U) -> Self
pub fn align_down<U>(self, align: U) -> Self
Aligns the address downwards to the given alignment.
See the align_down
function for more information.
sourcepub fn align_up<U>(self, align: U) -> Self
pub fn align_up<U>(self, align: U) -> Self
Aligns the address upwards to the given alignment.
See the align_up
function for more information.
sourcepub fn align_offset<U>(self, align: U) -> usize
pub fn align_offset<U>(self, align: U) -> usize
Returns the offset of the address within the given alignment.
See the align_offset
function for more information.
sourcepub fn is_aligned<U>(self, align: U) -> bool
pub fn is_aligned<U>(self, align: U) -> bool
Checks whether the address has the demanded alignment.
See the is_aligned
function for more information.
sourcepub fn align_down_4k(self) -> Self
pub fn align_down_4k(self) -> Self
Aligns the address downwards to 4096 (bytes).
sourcepub fn align_up_4k(self) -> Self
pub fn align_up_4k(self) -> Self
Aligns the address upwards to 4096 (bytes).
sourcepub fn align_offset_4k(self) -> usize
pub fn align_offset_4k(self) -> usize
Returns the offset of the address within a 4K-sized page.
sourcepub fn is_aligned_4k(self) -> bool
pub fn is_aligned_4k(self) -> bool
Checks whether the address is 4K-aligned.
Trait Implementations§
source§impl AddAssign<usize> for PhysAddr
impl AddAssign<usize> for PhysAddr
source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read moresource§impl Ord for PhysAddr
impl Ord for PhysAddr
source§impl PartialEq for PhysAddr
impl PartialEq for PhysAddr
source§impl PartialOrd for PhysAddr
impl PartialOrd for PhysAddr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SubAssign<usize> for PhysAddr
impl SubAssign<usize> for PhysAddr
source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-=
operation. Read moreimpl Copy for PhysAddr
impl Eq for PhysAddr
impl StructuralEq for PhysAddr
impl StructuralPartialEq for PhysAddr
Auto Trait Implementations§
impl RefUnwindSafe for PhysAddr
impl Send for PhysAddr
impl Sync for PhysAddr
impl Unpin for PhysAddr
impl UnwindSafe for PhysAddr
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