[][src]Struct sunrise_kernel::mem::VirtualAddress

#[repr(transparent)]pub struct VirtualAddress(pub usize);

Represents a Virtual address

Implementations

impl VirtualAddress[src]

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

Gets the address as a usize.

impl VirtualAddress[src]

pub fn checked_add(self, rhs: usize) -> Option<VirtualAddress>[src]

Tries to add an offset to a VirtualAddress, returning None if this would cause an overflow.

This function does not return a KernelError, as it does not know whether the address or the size is the cause of the error.

pub fn check_aligned_to(self, alignment: usize) -> Result<(), KernelError>[src]

Checks that this address meets the given alignment.

Errors

  • InvalidAddress: self is not aligned to alignment.

pub fn floor(self) -> VirtualAddress[src]

Rounds down to PAGE_SIZE.

pub fn ceil(self) -> VirtualAddress[src]

Rounds up PAGE_SIZE.

Trait Implementations

impl Add<VirtualAddress> for usize[src]

type Output = VirtualAddress

The resulting type after applying the + operator.

fn add(self, other: VirtualAddress) -> VirtualAddress[src]

Adding a length to an address gives another address

impl Add<usize> for VirtualAddress[src]

type Output = VirtualAddress

The resulting type after applying the + operator.

fn add(self, other: usize) -> VirtualAddress[src]

Adding a length to an address gives another address

impl AddAssign<usize> for VirtualAddress[src]

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

Adding a length to an address gives another address

impl Clone for VirtualAddress[src]

impl Copy for VirtualAddress[src]

impl Debug for VirtualAddress[src]

impl Display for VirtualAddress[src]

impl Eq for VirtualAddress[src]

impl Hash for VirtualAddress[src]

impl LowerHex for VirtualAddress[src]

impl Ord for VirtualAddress[src]

impl PartialEq<VirtualAddress> for VirtualAddress[src]

impl PartialOrd<VirtualAddress> for VirtualAddress[src]

impl Step for VirtualAddress[src]

impl StructuralEq for VirtualAddress[src]

impl StructuralPartialEq for VirtualAddress[src]

impl Sub<VirtualAddress> for VirtualAddress[src]

type Output = usize

The resulting type after applying the - operator.

fn sub(self, rhs: VirtualAddress) -> usize[src]

Subtracting two address gives their distance

impl Sub<usize> for VirtualAddress[src]

type Output = VirtualAddress

The resulting type after applying the - operator.

fn sub(self, other: usize) -> VirtualAddress[src]

Subtracting a length from an address gives another address

impl SubAssign<usize> for VirtualAddress[src]

fn sub_assign(&mut self, rhs: usize)[src]

Subtracting a length from an address gives another address

Auto Trait Implementations

impl RefUnwindSafe for VirtualAddress

impl Send for VirtualAddress

impl Sync for VirtualAddress

impl Unpin for VirtualAddress

impl UnwindSafe for VirtualAddress

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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.