Struct hermit::mm::VirtAddr[][src]

#[repr(transparent)]
pub struct VirtAddr(pub u64);
Expand description

A wrapper for a virtual address.

Implementations

impl VAddr[src]

pub const fn from_u64(v: u64) -> VAddr[src]

Convert from u64

pub const fn from_usize(v: usize) -> VAddr[src]

Convert from usize

pub const fn as_u64(self) -> u64[src]

Convert to u64

pub const fn as_usize(self) -> usize[src]

Convert to usize

pub fn as_mut_ptr<T>(self) -> *mut T[src]

Convert to mutable pointer.

pub fn as_ptr<T>(self) -> *const T[src]

Convert to pointer.

pub const fn zero() -> VAddr[src]

Virtual Address zero.

pub fn is_zero(self) -> bool[src]

Is zero?

pub fn base_page_offset(self) -> u64[src]

Offset within the 4 KiB page.

pub fn large_page_offset(self) -> u64[src]

Offset within the 2 MiB page.

pub fn huge_page_offset(self) -> u64[src]

Offset within the 1 GiB page.

pub fn align_down_to_base_page(self) -> VAddr[src]

Return address of nearest 4 KiB page (lower or equal than self).

pub fn align_down_to_large_page(self) -> VAddr[src]

Return address of nearest 2 MiB page (lower or equal than self).

pub fn align_down_to_huge_page(self) -> VAddr[src]

Return address of nearest 1 GiB page (lower or equal than self).

pub fn align_up_to_base_page(self) -> VAddr[src]

Return address of nearest 4 KiB page (higher or equal than self).

pub fn align_up_to_large_page(self) -> VAddr[src]

Return address of nearest 2 MiB page (higher or equal than self).

pub fn align_up_to_huge_page(self) -> VAddr[src]

Return address of nearest 1 GiB page (higher or equal than self).

pub fn is_base_page_aligned(self) -> bool[src]

Is this address aligned to a 4 KiB page?

pub fn is_large_page_aligned(self) -> bool[src]

Is this address aligned to a 2 MiB page?

pub fn is_huge_page_aligned(self) -> bool[src]

Is this address aligned to a 1 GiB page?

pub fn is_aligned<U>(self, align: U) -> bool where
    U: Into<u64> + Copy
[src]

Is this address aligned to align?

Note

align must be a power of two.

Trait Implementations

impl Add<VAddr> for VAddr[src]

type Output = VAddr

The resulting type after applying the + operator.

pub fn add(self, rhs: VAddr) -> <VAddr as Add<VAddr>>::Output[src]

Performs the + operation. Read more

impl Add<u64> for VAddr[src]

type Output = VAddr

The resulting type after applying the + operator.

pub fn add(self, rhs: u64) -> <VAddr as Add<u64>>::Output[src]

Performs the + operation. Read more

impl Add<usize> for VAddr[src]

type Output = VAddr

The resulting type after applying the + operator.

pub fn add(self, rhs: usize) -> <VAddr as Add<usize>>::Output[src]

Performs the + operation. Read more

impl AddAssign<VAddr> for VAddr[src]

pub fn add_assign(&mut self, other: VAddr)[src]

Performs the += operation. Read more

impl AddAssign<u64> for VAddr[src]

pub fn add_assign(&mut self, offset: u64)[src]

Performs the += operation. Read more

impl AddAssign<usize> for VAddr[src]

pub fn add_assign(&mut self, offset: usize)[src]

Performs the += operation. Read more

impl Binary for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter.

impl BitAnd<VAddr> for VAddr[src]

type Output = VAddr

The resulting type after applying the & operator.

pub fn bitand(self, rhs: VAddr) -> <VAddr as BitAnd<VAddr>>::Output[src]

Performs the & operation. Read more

impl BitAnd<i32> for VAddr[src]

type Output = VAddr

The resulting type after applying the & operator.

pub fn bitand(self, rhs: i32) -> <VAddr as BitAnd<i32>>::Output[src]

Performs the & operation. Read more

impl BitAnd<u64> for VAddr[src]

type Output = VAddr

The resulting type after applying the & operator.

pub fn bitand(self, rhs: u64) -> <VAddr as BitAnd<u64>>::Output[src]

Performs the & operation. Read more

impl BitAnd<usize> for VAddr[src]

type Output = VAddr

The resulting type after applying the & operator.

pub fn bitand(self, rhs: usize) -> <VAddr as BitAnd<usize>>::Output[src]

Performs the & operation. Read more

impl BitOr<VAddr> for VAddr[src]

type Output = VAddr

The resulting type after applying the | operator.

pub fn bitor(self, rhs: VAddr) -> VAddr[src]

Performs the | operation. Read more

impl BitOr<u64> for VAddr[src]

type Output = VAddr

The resulting type after applying the | operator.

pub fn bitor(self, rhs: u64) -> <VAddr as BitOr<u64>>::Output[src]

Performs the | operation. Read more

impl BitOr<usize> for VAddr[src]

type Output = VAddr

The resulting type after applying the | operator.

pub fn bitor(self, rhs: usize) -> <VAddr as BitOr<usize>>::Output[src]

Performs the | operation. Read more

impl Clone for VAddr[src]

pub fn clone(&self) -> VAddr[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Display for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl From<i32> for VAddr[src]

pub fn from(num: i32) -> VAddr[src]

Performs the conversion.

impl From<u64> for VAddr[src]

pub fn from(num: u64) -> VAddr[src]

Performs the conversion.

impl From<usize> for VAddr[src]

pub fn from(num: usize) -> VAddr[src]

Performs the conversion.

impl Hash for VAddr[src]

pub fn hash<H>(&self, state: &mut H) where
    H: Hasher
[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Into<u64> for VAddr[src]

pub fn into(self) -> u64[src]

Performs the conversion.

impl Into<usize> for VAddr[src]

pub fn into(self) -> usize[src]

Performs the conversion.

impl LowerHex for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter.

impl Octal for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter.

impl Ord for VAddr[src]

pub fn cmp(&self, other: &VAddr) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<VAddr> for VAddr[src]

pub fn eq(&self, other: &VAddr) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &VAddr) -> bool[src]

This method tests for !=.

impl PartialOrd<VAddr> for VAddr[src]

pub fn partial_cmp(&self, other: &VAddr) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Pointer for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter.

impl Rem<VAddr> for VAddr[src]

type Output = VAddr

The resulting type after applying the % operator.

pub fn rem(self, rhs: VAddr) -> <VAddr as Rem<VAddr>>::Output[src]

Performs the % operation. Read more

impl Rem<u64> for VAddr[src]

type Output = u64

The resulting type after applying the % operator.

pub fn rem(
    self,
    rhs: <VAddr as Rem<u64>>::Output
) -> <VAddr as Rem<u64>>::Output
[src]

Performs the % operation. Read more

impl Rem<usize> for VAddr[src]

type Output = usize

The resulting type after applying the % operator.

pub fn rem(
    self,
    rhs: <VAddr as Rem<usize>>::Output
) -> <VAddr as Rem<usize>>::Output
[src]

Performs the % operation. Read more

impl Shr<i32> for VAddr[src]

type Output = u64

The resulting type after applying the >> operator.

pub fn shr(self, rhs: i32) -> <VAddr as Shr<i32>>::Output[src]

Performs the >> operation. Read more

impl Shr<u64> for VAddr[src]

type Output = u64

The resulting type after applying the >> operator.

pub fn shr(self, rhs: u64) -> <VAddr as Shr<u64>>::Output[src]

Performs the >> operation. Read more

impl Shr<usize> for VAddr[src]

type Output = u64

The resulting type after applying the >> operator.

pub fn shr(self, rhs: usize) -> <VAddr as Shr<usize>>::Output[src]

Performs the >> operation. Read more

impl Sub<VAddr> for VAddr[src]

type Output = VAddr

The resulting type after applying the - operator.

pub fn sub(self, rhs: VAddr) -> <VAddr as Sub<VAddr>>::Output[src]

Performs the - operation. Read more

impl Sub<u64> for VAddr[src]

type Output = VAddr

The resulting type after applying the - operator.

pub fn sub(self, rhs: u64) -> <VAddr as Sub<u64>>::Output[src]

Performs the - operation. Read more

impl Sub<usize> for VAddr[src]

type Output = VAddr

The resulting type after applying the - operator.

pub fn sub(self, rhs: usize) -> <VAddr as Sub<usize>>::Output[src]

Performs the - operation. Read more

impl UpperHex for VAddr[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter.

impl Copy for VAddr[src]

impl Eq for VAddr[src]

impl StructuralEq for VAddr[src]

impl StructuralPartialEq for VAddr[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.