#[repr(transparent)]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) -> Self
pub const fn from_usize(v: usize) -> Self
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) -> Self
pub fn align_down_to_base_page(self) -> Self
Return address of nearest 4 KiB page (lower or equal than self).
Sourcepub fn align_down_to_large_page(self) -> Self
pub fn align_down_to_large_page(self) -> Self
Return address of nearest 2 MiB page (lower or equal than self).
Sourcepub fn align_down_to_huge_page(self) -> Self
pub fn align_down_to_huge_page(self) -> Self
Return address of nearest 1 GiB page (lower or equal than self).
Sourcepub fn align_up_to_base_page(self) -> Self
pub fn align_up_to_base_page(self) -> Self
Return address of nearest 4 KiB page (higher or equal than self).
Sourcepub fn align_up_to_large_page(self) -> Self
pub fn align_up_to_large_page(self) -> Self
Return address of nearest 2 MiB page (higher or equal than self).
Sourcepub fn align_up_to_huge_page(self) -> Self
pub fn align_up_to_huge_page(self) -> Self
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<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 AddAssign for VAddr
impl AddAssign for VAddr
Source§fn add_assign(&mut self, other: VAddr)
fn add_assign(&mut self, other: VAddr)
Performs the
+=
operation. Read moreSource§impl Ord for VAddr
impl Ord for VAddr
Source§impl PartialOrd for VAddr
impl PartialOrd for VAddr
impl Copy for VAddr
impl Eq for VAddr
impl StructuralPartialEq for VAddr
Auto Trait Implementations§
impl Freeze for VAddr
impl RefUnwindSafe for VAddr
impl Send for VAddr
impl Sync for VAddr
impl Unpin for VAddr
impl UnwindSafe for VAddr
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