#[repr(transparent)]pub struct PAddr(pub u64);
Expand description
A wrapper for a physical address.
Tuple Fields
0: u64
Implementations
sourceimpl PAddr
impl PAddr
sourcepub fn base_page_offset(self) -> u64
pub fn base_page_offset(self) -> u64
Offset within the 4 KiB page.
sourcepub fn large_page_offset(self) -> u64
pub fn large_page_offset(self) -> u64
Offset within the 2 MiB page.
sourcepub fn huge_page_offset(self) -> u64
pub fn huge_page_offset(self) -> u64
Offset within the 1 GiB page.
sourcepub fn align_down_to_base_page(self) -> Self
pub fn align_down_to_base_page(self) -> Self
Return address of nearest 4 KiB page (lower or equal than self).
sourcepub fn align_down_to_large_page(self) -> Self
pub fn align_down_to_large_page(self) -> Self
Return address of nearest 2 MiB page (lower or equal than self).
sourcepub fn align_down_to_huge_page(self) -> Self
pub fn align_down_to_huge_page(self) -> Self
Return address of nearest 1 GiB page (lower or equal than self).
sourcepub fn align_up_to_base_page(self) -> Self
pub fn align_up_to_base_page(self) -> Self
Return address of nearest 4 KiB page (higher or equal than self).
sourcepub fn align_up_to_large_page(self) -> Self
pub fn align_up_to_large_page(self) -> Self
Return address of nearest 2 MiB page (higher or equal than self).
sourcepub fn align_up_to_huge_page(self) -> Self
pub fn align_up_to_huge_page(self) -> Self
Return address of nearest 1 GiB page (higher or equal than self).
sourcepub fn is_base_page_aligned(self) -> bool
pub fn is_base_page_aligned(self) -> bool
Is this address aligned to a 4 KiB page?
sourcepub fn is_large_page_aligned(self) -> bool
pub fn is_large_page_aligned(self) -> bool
Is this address aligned to a 2 MiB page?
sourcepub fn is_huge_page_aligned(self) -> bool
pub fn is_huge_page_aligned(self) -> bool
Is this address aligned to a 1 GiB page?
Trait Implementations
sourceimpl AddAssign<PAddr> for PAddr
impl AddAssign<PAddr> for PAddr
sourcefn add_assign(&mut self, other: PAddr)
fn add_assign(&mut self, other: PAddr)
Performs the +=
operation. Read more
sourceimpl AddAssign<u64> for PAddr
impl AddAssign<u64> for PAddr
sourcefn add_assign(&mut self, offset: u64)
fn add_assign(&mut self, offset: u64)
Performs the +=
operation. Read more
sourceimpl Ord for PAddr
impl Ord for PAddr
sourceimpl PartialOrd<PAddr> for PAddr
impl PartialOrd<PAddr> for PAddr
sourcefn partial_cmp(&self, other: &PAddr) -> Option<Ordering>
fn partial_cmp(&self, other: &PAddr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for PAddr
impl Eq for PAddr
impl StructuralEq for PAddr
impl StructuralPartialEq for PAddr
Auto Trait Implementations
impl RefUnwindSafe for PAddr
impl Send for PAddr
impl Sync for PAddr
impl Unpin for PAddr
impl UnwindSafe for PAddr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more