pub struct PAddr(/* private fields */);
Expand description
Represents a physical address. If the target architecture has any requirements for valid physical addresses, they are always enforced.
Implementations§
Source§impl PAddr
impl PAddr
Sourcepub const fn new(address: usize) -> Option<PAddr>
pub const fn new(address: usize) -> Option<PAddr>
Construct a new PAddr
. The target architecture does not have any requirements on valid
physical addresses, so this always succeeds.
Sourcepub fn align_down(self, align: usize) -> PAddr
pub fn align_down(self, align: usize) -> PAddr
Align this address to the given alignment, moving downwards if this is not already aligned.
align
must be 0
or a power-of-two.
pub fn align_up(self, align: usize) -> PAddr
pub fn is_aligned(self, align: usize) -> bool
pub fn checked_add(self, rhs: usize) -> Option<Self>
pub fn checked_sub(self, rhs: usize) -> Option<Self>
Trait Implementations§
Source§impl AddAssign<usize> for PAddr
impl AddAssign<usize> for PAddr
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read moreSource§impl Ord for PAddr
impl Ord for PAddr
Source§impl PartialOrd for PAddr
impl PartialOrd for PAddr
Source§impl SubAssign<usize> for PAddr
impl SubAssign<usize> for PAddr
Source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-=
operation. Read moreimpl Copy for PAddr
impl Eq for PAddr
impl StructuralPartialEq for PAddr
Auto Trait Implementations§
impl Freeze for PAddr
impl RefUnwindSafe for PAddr
impl Send for PAddr
impl Sync for PAddr
impl Unpin for PAddr
impl UnwindSafe for PAddr
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
)