#[repr(transparent)]pub struct PhysicalAddress {
pub addr: usize,
}Expand description
A physical memory address
Fields§
§addr: usizeThe underlying address
Implementations§
Source§impl PhysicalAddress
impl PhysicalAddress
Sourcepub const fn new(addr: usize) -> Self
pub const fn new(addr: usize) -> Self
Creates a new PhysicalAddress
Sourcepub const fn to_virtual(self) -> VirtualAddress
pub const fn to_virtual(self) -> VirtualAddress
Converts an PhysicalAddress into an VirtualAddress via the physical page map region
The returned VirtualAddress is only safe to access if the PhysicalAddress points into conventional
RAM
Sourcepub const fn align_down_to_frame(self) -> RawFrame
pub const fn align_down_to_frame(self) -> RawFrame
Returns the closest RawFrame at or below the current address
Sourcepub const fn align_up_to_frame(self) -> RawFrame
pub const fn align_up_to_frame(self) -> RawFrame
Returns the closest RawFrame at or above the current address
Sourcepub const fn aligned_to(self, align: usize) -> bool
pub const fn aligned_to(self, align: usize) -> bool
Trait Implementations§
Source§impl Add<isize> for PhysicalAddress
impl Add<isize> for PhysicalAddress
Source§impl Add<usize> for PhysicalAddress
impl Add<usize> for PhysicalAddress
Source§impl Clone for PhysicalAddress
impl Clone for PhysicalAddress
Source§fn clone(&self) -> PhysicalAddress
fn clone(&self) -> PhysicalAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PhysicalAddress
impl Debug for PhysicalAddress
Source§impl From<RawFrame> for PhysicalAddress
impl From<RawFrame> for PhysicalAddress
Source§impl Hash for PhysicalAddress
impl Hash for PhysicalAddress
Source§impl LowerHex for PhysicalAddress
impl LowerHex for PhysicalAddress
Source§impl Ord for PhysicalAddress
impl Ord for PhysicalAddress
Source§fn cmp(&self, other: &PhysicalAddress) -> Ordering
fn cmp(&self, other: &PhysicalAddress) -> Ordering
1.21.0 (const: unstable)§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PhysicalAddress
impl PartialEq for PhysicalAddress
Source§impl PartialOrd for PhysicalAddress
impl PartialOrd for PhysicalAddress
Source§impl Step for PhysicalAddress
impl Step for PhysicalAddress
Source§fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
🔬This is a nightly-only experimental API. (
step_trait)Returns the bounds on the number of successor steps required to get from
start to end
like [Iterator::size_hint()][Iterator::size_hint()]. Read moreSource§fn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§impl Sub<isize> for PhysicalAddress
impl Sub<isize> for PhysicalAddress
Source§impl Sub<usize> for PhysicalAddress
impl Sub<usize> for PhysicalAddress
Source§impl Sub for PhysicalAddress
Returns the number of bytes between self and rhs
impl Sub for PhysicalAddress
Returns the number of bytes between self and rhs
impl Copy for PhysicalAddress
impl Eq for PhysicalAddress
impl StructuralPartialEq for PhysicalAddress
Auto Trait Implementations§
impl Freeze for PhysicalAddress
impl RefUnwindSafe for PhysicalAddress
impl Send for PhysicalAddress
impl Sync for PhysicalAddress
impl Unpin for PhysicalAddress
impl UnsafeUnpin for PhysicalAddress
impl UnwindSafe for PhysicalAddress
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more