Struct keos::addressing::Va

source ·
pub struct Va(_);
Expand description

Virtual address

Implementations§

source§

impl Va

source

pub const fn new(addr: usize) -> Option<Va>

Create a new virtual address with a check.

source

pub const unsafe fn into_usize(self) -> usize

Cast into usize.

source

pub const fn into_pa(self) -> Pa

Cast into physical address.

source

pub unsafe fn as_ref<'a, T>(&self) -> Option<&'a T>

Get reference of T underlying the Va.

Safety

When calling this method, you have to ensure that either the pointer is null or all of the following is true:

  • The pointer must be properly aligned.

  • It must be “dereferenceable” in the sense defined in the module documentation.

  • The pointer must point to an initialized instance of T.

This applies even if the result of this method is unused!

source

pub unsafe fn as_mut<'a, T>(&self) -> Option<&'a mut T>

Get mutable reference of T underlying the Va.

Safety

When calling this method, you have to ensure that either the pointer is null or all of the following is true:

  • The pointer must be properly aligned.

  • It must be “dereferenceable” in the sense defined in the module documentation.

  • The pointer must point to an initialized instance of T.

This applies even if the result of this method is unused!

Trait Implementations§

source§

impl Add<usize> for Va

§

type Output = Va

The resulting type after applying the + operator.
source§

fn add(self, other: usize) -> <Va as Add<usize>>::Output

Performs the + operation. Read more
source§

impl AddAssign<usize> for Va

source§

fn add_assign(&mut self, other: usize)

Performs the += operation. Read more
source§

impl BitAnd<usize> for Va

§

type Output = Va

The resulting type after applying the & operator.
source§

fn bitand(self, other: usize) -> Va

Performs the & operation. Read more
source§

impl BitAndAssign<usize> for Va

source§

fn bitand_assign(&mut self, other: usize)

Performs the &= operation. Read more
source§

impl BitOr<usize> for Va

§

type Output = Va

The resulting type after applying the | operator.
source§

fn bitor(self, other: usize) -> Va

Performs the | operation. Read more
source§

impl BitOrAssign<usize> for Va

source§

fn bitor_assign(&mut self, other: usize)

Performs the |= operation. Read more
source§

impl Clone for Va

source§

fn clone(&self) -> Va

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Va

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Va

source§

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

Formats the value using the given formatter. Read more
source§

impl Ord for Va

source§

fn cmp(&self, other: &Va) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Va> for Va

source§

fn eq(&self, other: &Va) -> bool

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

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Va> for Va

source§

fn partial_cmp(&self, other: &Va) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

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 more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Sub<usize> for Va

§

type Output = Va

The resulting type after applying the - operator.
source§

fn sub(self, other: usize) -> <Va as Sub<usize>>::Output

Performs the - operation. Read more
source§

impl SubAssign<usize> for Va

source§

fn sub_assign(&mut self, other: usize)

Performs the -= operation. Read more
source§

impl Copy for Va

source§

impl Eq for Va

source§

impl StructuralEq for Va

source§

impl StructuralPartialEq for Va

Auto Trait Implementations§

§

impl RefUnwindSafe for Va

§

impl Send for Va

§

impl Sync for Va

§

impl Unpin for Va

§

impl UnwindSafe for Va

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

const: unstable§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere T: Display + ?Sized,

§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable§

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

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable§

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

Performs the conversion.