#[repr(transparent)]pub struct VirtAddr(u64);Expand description
A type representing virtual addresses in the CPU’s virtual address space
Tuple Fields§
§0: u64Implementations§
Source§impl VirtAddr
impl VirtAddr
Sourcepub fn from_ptr<T>(ptr: *const T) -> Self
pub fn from_ptr<T>(ptr: *const T) -> Self
Creates a new VirtAddr from a *const T or *mut T pointer
Sourcepub fn as_mut_ptr<T>(self) -> *mut T
pub fn as_mut_ptr<T>(self) -> *mut T
Returns the address as a *mut T pointer
Sourcepub fn align_up(self, align: u64) -> Self
pub fn align_up(self, align: u64) -> Self
Returns a new address aligned to the next larger address which is aligned to align
§Panics
In debug builds if align is not a power of two
Sourcepub fn align_down(self, align: u64) -> Self
pub fn align_down(self, align: u64) -> Self
Returns a new address aligned to the next smaller address which is aligned to align
§Panics
In debug builds if align is not a power of two
Sourcepub fn is_aligned(self, align: u64) -> bool
pub fn is_aligned(self, align: u64) -> bool
Check whether the address is aligned to align
Source§impl VirtAddr
impl VirtAddr
Sourcepub fn p1_index(self) -> PageTableIndex
pub fn p1_index(self) -> PageTableIndex
Returns the index into the P1 page table (PT) for this virtual address, in range 0..512
Sourcepub fn p2_index(self) -> PageTableIndex
pub fn p2_index(self) -> PageTableIndex
Returns the index into the P2 page table (PD) for this virtual address, in range 0..512
Trait Implementations§
Source§impl AddAssign for VirtAddr
impl AddAssign for VirtAddr
Source§fn add_assign(&mut self, rhs: VirtAddr)
fn add_assign(&mut self, rhs: VirtAddr)
AddAssign trait for add-assigning a VirtAddr to a VirtAddr
Source§impl AddAssign<u64> for VirtAddr
impl AddAssign<u64> for VirtAddr
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
AddAssign trait for add-assigning a u64 to a VirtAddr
impl Copy for VirtAddr
impl Eq for VirtAddr
Source§impl Ord for VirtAddr
impl Ord for VirtAddr
1.21.0 (const: unstable)§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable)§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for VirtAddr
impl PartialOrd for VirtAddr
impl StructuralPartialEq for VirtAddr
Source§impl SubAssign for VirtAddr
impl SubAssign for VirtAddr
Source§fn sub_assign(&mut self, rhs: VirtAddr)
fn sub_assign(&mut self, rhs: VirtAddr)
SubAssign trait for sub-assigning a VirtAddr from a VirtAddr
Auto Trait Implementations§
impl Freeze for VirtAddr
impl RefUnwindSafe for VirtAddr
impl Send for VirtAddr
impl Sync for VirtAddr
impl Unpin for VirtAddr
impl UnsafeUnpin for VirtAddr
impl UnwindSafe for VirtAddr
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
§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)
clone_to_uninit)