#[repr(transparent)]
pub struct VirtAddr(_);
A canonical 64-bit virtual memory address.
This is a wrapper type around an u64
, so it is always 8 bytes, even when compiled
on non 64-bit systems. The UsizeConversions
trait can be used for performing conversions
between u64
and usize
.
On x86_64
, only the 48 lower bits of a virtual address can be used. The top 16 bits need
to be copies of bit 47, i.e. the most significant bit. Addresses that fulfil this criterium
are called “canonical”. This type guarantees that it always represents a canonical address.
Creates a new canonical virtual address.
This function performs sign extension of bit 47 to make the address canonical. Panics
if the bits in the range 48 to 64 contain data (i.e. are not null and no sign extension).
Tries to create a new canonical virtual address.
This function tries to performs sign
extension of bit 47 to make the address canonical. It succeeds if bits 48 to 64 are
either a correct sign extension (i.e. copies of bit 47) or all null. Else, an error
is returned.
Creates a new canonical virtual address without checks.
This function performs sign extension of bit 47 to make the address canonical, so
bits 48 to 64 are overwritten. If you want to check that these bits contain no data,
use new
or try_new
.
Creates a virtual address that points to 0
.
Converts the address to an u64
.
Creates a virtual address from the given pointer
Aligns the virtual address upwards to the given alignment.
See the align_up
function for more information.
Aligns the virtual address downwards to the given alignment.
See the align_down
function for more information.
Checks whether the virtual address has the demanded alignment.
Returns the 12-bit page offset of this virtual address.
Returns the 9-bit level 1 page table index.
Returns the 9-bit level 2 page table index.
Returns the 9-bit level 3 page table index.
Returns the 9-bit level 4 page table index.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the -
operator.
Performs the -
operation.
The resulting type after applying the -
operator.
Performs the -
operation.
The resulting type after applying the -
operator.
Performs the -
operation.
The resulting type after applying the +
operator.
Performs the +
operation.
The resulting type after applying the +
operator.
Performs the +
operation.
Performs the +=
operation.
Performs the +=
operation.
Performs the -=
operation.
Performs the -=
operation.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static