pub struct VAddr(pub u64);
Expand description
A wrapper for a virtual address.
Tuple Fields§
§0: u64
Implementations§
source§impl VAddr
impl VAddr
sourcepub const fn from_usize(v: usize) -> VAddr
pub const fn from_usize(v: usize) -> VAddr
Convert from usize
sourcepub fn as_mut_ptr<T>(self) -> *mut T
pub fn as_mut_ptr<T>(self) -> *mut T
Convert to mutable pointer.
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) -> VAddr
pub fn align_down_to_base_page(self) -> VAddr
Return address of nearest 4 KiB page (lower or equal than self).
sourcepub fn align_down_to_large_page(self) -> VAddr
pub fn align_down_to_large_page(self) -> VAddr
Return address of nearest 2 MiB page (lower or equal than self).
sourcepub fn align_down_to_huge_page(self) -> VAddr
pub fn align_down_to_huge_page(self) -> VAddr
Return address of nearest 1 GiB page (lower or equal than self).
sourcepub fn align_up_to_base_page(self) -> VAddr
pub fn align_up_to_base_page(self) -> VAddr
Return address of nearest 4 KiB page (higher or equal than self).
sourcepub fn align_up_to_large_page(self) -> VAddr
pub fn align_up_to_large_page(self) -> VAddr
Return address of nearest 2 MiB page (higher or equal than self).
sourcepub fn align_up_to_huge_page(self) -> VAddr
pub fn align_up_to_huge_page(self) -> VAddr
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§
source§impl AddAssign<VAddr> for VAddr
impl AddAssign<VAddr> for VAddr
source§fn add_assign(&mut self, other: VAddr)
fn add_assign(&mut self, other: VAddr)
Performs the
+=
operation. Read moresource§impl AddAssign<u64> for VAddr
impl AddAssign<u64> for VAddr
source§fn add_assign(&mut self, offset: u64)
fn add_assign(&mut self, offset: u64)
Performs the
+=
operation. Read moresource§impl AddAssign<usize> for VAddr
impl AddAssign<usize> for VAddr
source§fn add_assign(&mut self, offset: usize)
fn add_assign(&mut self, offset: usize)
Performs the
+=
operation. Read moresource§impl Ord for VAddr
impl Ord for VAddr
source§impl PartialEq<VAddr> for VAddr
impl PartialEq<VAddr> for VAddr
source§impl PartialOrd<VAddr> for VAddr
impl PartialOrd<VAddr> for VAddr
1.0.0 · source§fn 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 moresource§impl Step for VAddr
impl Step for VAddr
source§fn steps_between(start: &VAddr, end: &VAddr) -> Option<usize>
fn steps_between(start: &VAddr, end: &VAddr) -> Option<usize>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn forward_checked(start: VAddr, count: usize) -> Option<VAddr>
fn forward_checked(start: VAddr, count: usize) -> Option<VAddr>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn backward_checked(start: VAddr, count: usize) -> Option<VAddr>
fn backward_checked(start: VAddr, count: usize) -> Option<VAddr>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§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
)source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§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
)