Struct VirtAddr
pub struct VirtAddr(/* private fields */);
Expand description
A virtual memory address.
Implementations§
§impl VirtAddr
impl VirtAddr
pub fn from_ptr_of<T>(ptr: *const T) -> VirtAddr
pub fn from_ptr_of<T>(ptr: *const T) -> VirtAddr
Creates a new virtual address from a raw pointer.
pub fn from_mut_ptr_of<T>(ptr: *mut T) -> VirtAddr
pub fn from_mut_ptr_of<T>(ptr: *mut T) -> VirtAddr
Creates a new virtual address from a mutable raw pointer.
pub const fn as_ptr_of<T>(self) -> *const T
pub const fn as_ptr_of<T>(self) -> *const T
Converts the virtual address to a raw pointer of a specific type.
pub const fn as_mut_ptr(self) -> *mut u8
pub const fn as_mut_ptr(self) -> *mut u8
Converts the virtual address to a mutable raw pointer.
pub const fn as_mut_ptr_of<T>(self) -> *mut T
pub const fn as_mut_ptr_of<T>(self) -> *mut T
Converts the virtual address to a mutable raw pointer of a specific type.
Trait Implementations§
§impl AddAssign<usize> for VirtAddr
impl AddAssign<usize> for VirtAddr
§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read more§impl Ord for VirtAddr
impl Ord for VirtAddr
§impl PartialOrd for VirtAddr
impl PartialOrd for VirtAddr
§impl SubAssign<usize> for VirtAddr
impl SubAssign<usize> for VirtAddr
§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
Performs the
-=
operation. Read moreimpl Copy for VirtAddr
impl Eq for VirtAddr
impl StructuralPartialEq for 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 UnwindSafe for VirtAddr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> MemoryAddr for T
impl<T> MemoryAddr for T
§fn align_down<U>(self, align: U) -> Self
fn align_down<U>(self, align: U) -> Self
Aligns the address downwards to the given alignment.
§fn align_offset<U>(self, align: U) -> usize
fn align_offset<U>(self, align: U) -> usize
Returns the offset of the address within the given alignment.
§fn is_aligned<U>(self, align: U) -> bool
fn is_aligned<U>(self, align: U) -> bool
Checks whether the address has the demanded alignment.
§fn align_down_4k(self) -> Self
fn align_down_4k(self) -> Self
Aligns the address downwards to 4096 (bytes).
§fn align_up_4k(self) -> Self
fn align_up_4k(self) -> Self
Aligns the address upwards to 4096 (bytes).
§fn align_offset_4k(self) -> usize
fn align_offset_4k(self) -> usize
Returns the offset of the address within a 4K-sized page.
§fn is_aligned_4k(self) -> bool
fn is_aligned_4k(self) -> bool
Checks whether the address is 4K-aligned.
§fn offset(self, offset: isize) -> Self
fn offset(self, offset: isize) -> Self
Adds a given offset to the address to get a new address. Read more
§fn wrapping_offset(self, offset: isize) -> Self
fn wrapping_offset(self, offset: isize) -> Self
Adds a given offset to the address to get a new address. Read more
§fn offset_from(self, base: Self) -> isize
fn offset_from(self, base: Self) -> isize
Gets the distance between two addresses. Read more
§fn add(self, rhs: usize) -> Self
fn add(self, rhs: usize) -> Self
Adds a given unsigned offset to the address to get a new address. Read more
§fn wrapping_add(self, rhs: usize) -> Self
fn wrapping_add(self, rhs: usize) -> Self
Adds a given unsigned offset to the address to get a new address. Read more
§fn overflowing_add(self, rhs: usize) -> (Self, bool)
fn overflowing_add(self, rhs: usize) -> (Self, bool)
Adds a given unsigned offset to the address to get a new address. Read more
§fn checked_add(self, rhs: usize) -> Option<Self>
fn checked_add(self, rhs: usize) -> Option<Self>
Adds a given unsigned offset to the address to get a new address. Read more
§fn sub(self, rhs: usize) -> Self
fn sub(self, rhs: usize) -> Self
Subtracts a given unsigned offset from the address to get a new address. Read more
§fn wrapping_sub(self, rhs: usize) -> Self
fn wrapping_sub(self, rhs: usize) -> Self
Subtracts a given unsigned offset from the address to get a new address. Read more
§fn overflowing_sub(self, rhs: usize) -> (Self, bool)
fn overflowing_sub(self, rhs: usize) -> (Self, bool)
Subtracts a given unsigned offset from the address to get a new address. Read more
§fn checked_sub(self, rhs: usize) -> Option<Self>
fn checked_sub(self, rhs: usize) -> Option<Self>
Subtracts a given unsigned offset from the address to get a new address. Read more
§fn sub_addr(self, rhs: Self) -> usize
fn sub_addr(self, rhs: Self) -> usize
Subtracts another address from the address to get the offset between them. Read more
§fn wrapping_sub_addr(self, rhs: Self) -> usize
fn wrapping_sub_addr(self, rhs: Self) -> usize
Subtracts another address from the address to get the offset between them. Read more
§fn overflowing_sub_addr(self, rhs: Self) -> (usize, bool)
fn overflowing_sub_addr(self, rhs: Self) -> (usize, bool)
Subtracts another address from the address to get the offset between them. Read more
§fn checked_sub_addr(self, rhs: Self) -> Option<usize>
fn checked_sub_addr(self, rhs: Self) -> Option<usize>
Subtracts another address from the address to get the offset between them. Read more