#[repr(transparent)]pub struct VAddr(pub u32);
Expand description
A wrapper for a virtual address.
Tuple Fields
0: u32
Implementations
sourceimpl 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) -> u32
pub fn base_page_offset(self) -> u32
Offset within the 4 KiB page.
sourcepub fn large_page_offset(self) -> u32
pub fn large_page_offset(self) -> u32
Offset within the 4 MiB 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 4 MiB 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 4 MiB 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 4 MiB page?
Trait Implementations
sourceimpl AddAssign<VAddr> for VAddr
impl AddAssign<VAddr> for VAddr
sourcefn add_assign(&mut self, other: VAddr)
fn add_assign(&mut self, other: VAddr)
Performs the
+=
operation. Read moresourceimpl AddAssign<u32> for VAddr
impl AddAssign<u32> for VAddr
sourcefn add_assign(&mut self, offset: u32)
fn add_assign(&mut self, offset: u32)
Performs the
+=
operation. Read moresourceimpl AddAssign<usize> for VAddr
impl AddAssign<usize> for VAddr
sourcefn add_assign(&mut self, offset: usize)
fn add_assign(&mut self, offset: usize)
Performs the
+=
operation. Read moresourceimpl Ord for VAddr
impl Ord for VAddr
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<VAddr> for VAddr
impl PartialOrd<VAddr> for VAddr
sourcefn partial_cmp(&self, other: &VAddr) -> Option<Ordering>
fn partial_cmp(&self, other: &VAddr) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moreimpl Copy for VAddr
impl Eq for VAddr
impl StructuralEq for VAddr
impl StructuralPartialEq for VAddr
Auto Trait Implementations
impl RefUnwindSafe for VAddr
impl Send for VAddr
impl Sync for VAddr
impl Unpin for VAddr
impl UnwindSafe for VAddr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more