Struct x86_64::PhysAddr
[−]
[src]
#[repr(C)]pub struct PhysAddr(_);
A 64-bit physical memory address.
This is a wrapper type around an u64
, so it is always 8 bytes, even when compiled
on non 64-bit systems. The UsizeConversions
trait can be used for performing conversions
between u64
and usize
.
On x86_64
, only the 52 lower bits of a physical address can be used. The top 12 bits need
to be zero. This type guarantees that it always represents a valid physical address.
Methods
impl PhysAddr
[src]
fn new(addr: u64) -> PhysAddr
[src]
Creates a new physical address.
Panics if a bit in the range 52 to 64 is set.
fn try_new(addr: u64) -> Result<PhysAddr, PhysAddrNotValid>
[src]
Tries to create a new physical address.
Fails if any bits in the range 52 to 64 are set.
fn as_u64(self) -> u64
[src]
Converts the address to an u64
.
fn is_null(&self) -> bool
[src]
Convenience method for checking if a physical address is null.
fn align_up<U>(self, align: U) -> Self where
U: Into<u64>,
[src]
U: Into<u64>,
Aligns the physical address upwards to the given alignment.
See the align_up
function for more information.
fn align_down<U>(self, align: U) -> Self where
U: Into<u64>,
[src]
U: Into<u64>,
Aligns the physical address downwards to the given alignment.
See the align_down
function for more information.
Trait Implementations
impl Clone for PhysAddr
[src]
fn clone(&self) -> PhysAddr
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for PhysAddr
[src]
impl PartialEq for PhysAddr
[src]
fn eq(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests for !=
.
impl Eq for PhysAddr
[src]
impl PartialOrd for PhysAddr
[src]
fn partial_cmp(&self, __arg_0: &PhysAddr) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &PhysAddr) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for PhysAddr
[src]
fn cmp(&self, __arg_0: &PhysAddr) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Debug for PhysAddr
[src]
impl Binary for PhysAddr
[src]
impl LowerHex for PhysAddr
[src]
impl Octal for PhysAddr
[src]
impl UpperHex for PhysAddr
[src]
impl Add<u64> for PhysAddr
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Self::Output
[src]
Performs the +
operation.
impl AddAssign<u64> for PhysAddr
[src]
fn add_assign(&mut self, rhs: u64)
[src]
Performs the +=
operation.
impl Sub<u64> for PhysAddr
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: u64) -> Self::Output
[src]
Performs the -
operation.
impl SubAssign<u64> for PhysAddr
[src]
fn sub_assign(&mut self, rhs: u64)
[src]
Performs the -=
operation.
impl Step for PhysAddr
[src]
fn steps_between(start: &Self, end: &Self) -> Option<usize>
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Returns the number of steps between two step objects. The count is inclusive of start
and exclusive of end
. Read more
fn replace_one(&mut self) -> Self
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Replaces this step with 1
, returning itself
fn replace_zero(&mut self) -> Self
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Replaces this step with 0
, returning itself
fn add_one(&self) -> Self
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Adds one to this step, returning the result
fn sub_one(&self) -> Self
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Subtracts one to this step, returning the result
fn add_usize(&self, n: usize) -> Option<Self>
[src]
🔬 This is a nightly-only experimental API. (step_trait
)
likely to be replaced by finer-grained traits
Add an usize, returning None on overflow