pub struct PhysAddr(/* private fields */);
Expand description
A physical memory address.
The size of a valid physical address on aarch64 is implementation defined, but since Armv9.3 not larger than 56 bits. This type enforces this limit.
Implementations§
Source§impl PhysAddr
impl PhysAddr
Sourcepub const unsafe fn new_unsafe(addr: u64) -> PhysAddr
pub const unsafe fn new_unsafe(addr: u64) -> PhysAddr
Creates a new address, without any checks.
§Safety
If addr
does not comply with the platforms requirements for
this address type, this can lead to UB in functions relying on
the compliance or when using the requirements.
Source§impl PhysAddr
impl PhysAddr
Sourcepub const fn new_truncate(addr: u64) -> PhysAddr
pub const fn new_truncate(addr: u64) -> PhysAddr
Creates a new physical address truncating non-address parts.
Sourcepub const fn try_new(addr: u64) -> Result<Self, PhysAddrNotValid>
pub const fn try_new(addr: u64) -> Result<Self, PhysAddrNotValid>
Tries to create a new physical address.
Fails if any bits in the range 56 to 64 are set.
pub const fn as_usize(&self) -> usize
Trait Implementations§
Source§impl AddAssign<u64> for PhysAddr
impl AddAssign<u64> for PhysAddr
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moreSource§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 BitAndAssign<u64> for PhysAddr
impl BitAndAssign<u64> for PhysAddr
Source§fn bitand_assign(&mut self, rhs: u64)
fn bitand_assign(&mut self, rhs: u64)
Performs the
&=
operation. Read moreSource§impl BitOrAssign<u64> for PhysAddr
impl BitOrAssign<u64> for PhysAddr
Source§fn bitor_assign(&mut self, rhs: u64)
fn bitor_assign(&mut self, rhs: u64)
Performs the
|=
operation. Read moreSource§impl BitXorAssign<u64> for PhysAddr
impl BitXorAssign<u64> for PhysAddr
Source§fn bitxor_assign(&mut self, rhs: u64)
fn bitxor_assign(&mut self, rhs: u64)
Performs the
^=
operation. Read moreSource§impl MemoryAddress for PhysAddr
impl MemoryAddress for PhysAddr
Source§impl Ord for PhysAddr
impl Ord for PhysAddr
Source§impl PartialOrd for PhysAddr
impl PartialOrd for PhysAddr
Source§impl ShlAssign<usize> for PhysAddr
impl ShlAssign<usize> for PhysAddr
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the
<<=
operation. Read moreSource§impl ShrAssign<usize> for PhysAddr
impl ShrAssign<usize> for PhysAddr
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the
>>=
operation. Read moreSource§impl SubAssign<u64> for PhysAddr
impl SubAssign<u64> for PhysAddr
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. 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 StructuralPartialEq for PhysAddr
Auto Trait Implementations§
impl Freeze for PhysAddr
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