[][src]Struct memflow::types::physical_address::PhysicalAddress

#[repr(C)]pub struct PhysicalAddress { /* fields omitted */ }

This type represents a wrapper over a address with additional information about the containing page in the physical memory domain.

This type will mostly be used by the virtual to physical address translation. When a physical address is translated from a virtual address the additional information about the allocated page the virtual address points to can be obtained from this structure.

Most architectures have support multiple page sizes (see huge pages) which will be represented by the containing page of the PhysicalAddress struct.

Implementations

impl PhysicalAddress[src]

pub const NULL: PhysicalAddress[src]

A physical address with a value of zero.

pub const INVALID: PhysicalAddress[src]

A physical address with an invalid value.

pub const fn null() -> Self[src]

Returns a physical address with a value of zero.

pub fn with_page(
    address: Address,
    page_type: PageType,
    page_size: usize
) -> Self
[src]

Constructs a new PhysicalAddress form an Address with additional information about the page this address is contained in.

Note: The page size must be a power of 2.

pub const fn is_null(&self) -> bool[src]

Checks wether the physical address is zero or not.

pub const fn invalid() -> Self[src]

Returns a physical address that is invalid.

pub const fn is_valid(&self) -> bool[src]

Checks wether the physical is valid or not.

pub const fn has_page(&self) -> bool[src]

Checks wether the physical address also contains page informations or not.

pub const fn address(&self) -> Address[src]

Returns the address of this physical address.

pub const fn page_type(&self) -> PageType[src]

Returns the type of page this physical address is contained in.

pub fn page_size(&self) -> usize[src]

Returns the size of the page this physical address is contained in.

pub fn page_base(&self) -> Address[src]

Returns the base address of the containing page.

pub fn containing_page(&self) -> Page[src]

Converts the physical address into it's containing page page

pub const fn as_u32(&self) -> u32[src]

Returns the containing address converted to a u32.

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

Returns the internal u64 value of the address.

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

Returns the containing address converted to a usize.

Trait Implementations

impl Clone for PhysicalAddress[src]

impl Copy for PhysicalAddress[src]

impl Debug for PhysicalAddress[src]

impl Default for PhysicalAddress[src]

Returns a physical address with a value of zero.

impl<'de> Deserialize<'de> for PhysicalAddress[src]

impl Display for PhysicalAddress[src]

impl Eq for PhysicalAddress[src]

impl From<Address> for PhysicalAddress[src]

Converts a Address into a PhysicalAddress with no page information attached.

impl From<PhysicalAddress> for Address[src]

Converts a PhysicalAddress into a Address.

impl From<i32> for PhysicalAddress[src]

Constructs an PhysicalAddress from a i32 value.

impl From<u32> for PhysicalAddress[src]

Constructs an PhysicalAddress from a u32 value.

impl From<u64> for PhysicalAddress[src]

Constructs an PhysicalAddress from a u64 value.

impl From<usize> for PhysicalAddress[src]

Constructs an PhysicalAddress from a usize value.

impl LowerHex for PhysicalAddress[src]

impl Ord for PhysicalAddress[src]

impl PartialEq<PhysicalAddress> for PhysicalAddress[src]

impl PartialOrd<PhysicalAddress> for PhysicalAddress[src]

impl Serialize for PhysicalAddress[src]

impl StructuralEq for PhysicalAddress[src]

impl StructuralPartialEq for PhysicalAddress[src]

impl UpperHex for PhysicalAddress[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.