[−][src]Struct memflow::types::physical_address::PhysicalAddress
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]
address: Address,
page_type: PageType,
page_size: usize
) -> Self
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]
fn clone(&self) -> PhysicalAddress
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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
.
fn from(address: PhysicalAddress) -> Self
[src]
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]
fn cmp(&self, other: &PhysicalAddress) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<PhysicalAddress> for PhysicalAddress
[src]
fn eq(&self, other: &PhysicalAddress) -> bool
[src]
fn ne(&self, other: &PhysicalAddress) -> bool
[src]
impl PartialOrd<PhysicalAddress> for PhysicalAddress
[src]
fn partial_cmp(&self, other: &PhysicalAddress) -> Option<Ordering>
[src]
fn lt(&self, other: &PhysicalAddress) -> bool
[src]
fn le(&self, other: &PhysicalAddress) -> bool
[src]
fn gt(&self, other: &PhysicalAddress) -> bool
[src]
fn ge(&self, other: &PhysicalAddress) -> bool
[src]
impl Serialize for PhysicalAddress
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for PhysicalAddress
[src]
impl StructuralPartialEq for PhysicalAddress
[src]
impl UpperHex for PhysicalAddress
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,