pub struct VirtAddr(/* private fields */);
Expand description
A virtual memory address.
Implementations§
Source§impl VirtAddr
impl VirtAddr
Sourcepub const unsafe fn new_unsafe(addr: usize) -> VirtAddr
pub const unsafe fn new_unsafe(addr: usize) -> VirtAddr
Creates a new address, without any checks.
§Safety
If addr
does not comply with the platforms requirements for
this address type, this can lead to UB in functions relying on
the compliance or when using the requirements.
Source§impl VirtAddr
impl VirtAddr
Sourcepub const fn try_new(addr: usize) -> Result<VirtAddr, VirtAddrNotValid>
pub const fn try_new(addr: usize) -> Result<VirtAddr, VirtAddrNotValid>
Tries to create a new canonical virtual address.
Sourcepub const fn new_truncate(addr: usize) -> VirtAddr
pub const fn new_truncate(addr: usize) -> VirtAddr
Creates a new virtual address truncating non-address parts.
Sourcepub fn from_ptr<T: ?Sized>(ptr: *const T) -> Self
pub fn from_ptr<T: ?Sized>(ptr: *const T) -> Self
Creates a virtual address from the given pointer
Sourcepub const fn as_mut_ptr<T>(self) -> *mut T
pub const fn as_mut_ptr<T>(self) -> *mut T
Converts the address to a mutable raw pointer.
Trait Implementations§
Source§impl AddAssign<usize> for VirtAddr
impl AddAssign<usize> for VirtAddr
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read moreSource§impl BitAndAssign<usize> for VirtAddr
impl BitAndAssign<usize> for VirtAddr
Source§fn bitand_assign(&mut self, rhs: usize)
fn bitand_assign(&mut self, rhs: usize)
Performs the
&=
operation. Read moreSource§impl BitOrAssign<usize> for VirtAddr
impl BitOrAssign<usize> for VirtAddr
Source§fn bitor_assign(&mut self, rhs: usize)
fn bitor_assign(&mut self, rhs: usize)
Performs the
|=
operation. Read moreSource§impl BitXorAssign<usize> for VirtAddr
impl BitXorAssign<usize> for VirtAddr
Source§fn bitxor_assign(&mut self, rhs: usize)
fn bitxor_assign(&mut self, rhs: usize)
Performs the
^=
operation. Read moreSource§impl MemoryAddress for VirtAddr
impl MemoryAddress for VirtAddr
Source§impl Ord for VirtAddr
impl Ord for VirtAddr
Source§impl PartialOrd for VirtAddr
impl PartialOrd for VirtAddr
Source§impl ShlAssign<usize> for VirtAddr
impl ShlAssign<usize> for VirtAddr
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the
<<=
operation. Read moreSource§impl ShrAssign<usize> for VirtAddr
impl ShrAssign<usize> for VirtAddr
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the
>>=
operation. Read moreSource§impl SubAssign<usize> for VirtAddr
impl SubAssign<usize> for VirtAddr
Source§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