[][src]Struct sunrise_kernel::mem::PhysicalAddress

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

Represents a Physical address

Implementations

impl PhysicalAddress[src]

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

Gets the address as a usize.

impl PhysicalAddress[src]

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

Tries to add an offset to a PhysicalAddress, 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) -> PhysicalAddress[src]

Rounds down to PAGE_SIZE.

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

Rounds up PAGE_SIZE.

Trait Implementations

impl Add<PhysicalAddress> for usize[src]

type Output = PhysicalAddress

The resulting type after applying the + operator.

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

Adding a length to an address gives another address

impl Add<usize> for PhysicalAddress[src]

type Output = PhysicalAddress

The resulting type after applying the + operator.

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

Adding a length to an address gives another address

impl AddAssign<usize> for PhysicalAddress[src]

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

Adding a length to an address gives another address

impl Clone for PhysicalAddress[src]

impl Copy for PhysicalAddress[src]

impl Debug for PhysicalAddress[src]

impl Display for PhysicalAddress[src]

impl Eq for PhysicalAddress[src]

impl Hash for PhysicalAddress[src]

impl LowerHex for PhysicalAddress[src]

impl Ord for PhysicalAddress[src]

impl PartialEq<PhysicalAddress> for PhysicalAddress[src]

impl PartialOrd<PhysicalAddress> for PhysicalAddress[src]

impl Step for PhysicalAddress[src]

impl StructuralEq for PhysicalAddress[src]

impl StructuralPartialEq for PhysicalAddress[src]

impl Sub<PhysicalAddress> for PhysicalAddress[src]

type Output = usize

The resulting type after applying the - operator.

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

Subtracting two address gives their distance

impl Sub<usize> for PhysicalAddress[src]

type Output = PhysicalAddress

The resulting type after applying the - operator.

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

Subtracting a length from an address gives another address

impl SubAssign<usize> for PhysicalAddress[src]

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

Subtracting a length from an address gives another address

Auto Trait Implementations

impl RefUnwindSafe for PhysicalAddress

impl Send for PhysicalAddress

impl Sync for PhysicalAddress

impl Unpin for PhysicalAddress

impl UnwindSafe for PhysicalAddress

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.