Struct memory_structs::Page
source · pub struct Page { /* private fields */ }
Expand description
A Page
is a chunk of virtual memory aligned to a [PAGE_SIZE
] boundary.
Implementations§
source§impl Page
impl Page
sourcepub const fn start_address(&self) -> VirtualAddress
pub const fn start_address(&self) -> VirtualAddress
Returns the VirtualAddress
at the start of this Page
.
sourcepub const fn containing_address(addr: VirtualAddress) -> Page
pub const fn containing_address(addr: VirtualAddress) -> Page
Returns the Page
containing the given VirtualAddress
.
source§impl Page
impl Page
sourcepub const fn p4_index(&self) -> usize
pub const fn p4_index(&self) -> usize
Returns the 9-bit part of this Page
’s VirtualAddress
that is the index into the P4 page table entries list.
sourcepub const fn p3_index(&self) -> usize
pub const fn p3_index(&self) -> usize
Returns the 9-bit part of this Page
’s VirtualAddress
that is the index into the P3 page table entries list.
sourcepub const fn p2_index(&self) -> usize
pub const fn p2_index(&self) -> usize
Returns the 9-bit part of this Page
’s VirtualAddress
that is the index into the P2 page table entries list.
sourcepub const fn p1_index(&self) -> usize
pub const fn p1_index(&self) -> usize
Returns the 9-bit part of this Page
’s VirtualAddress
that is the index into the P1 page table entries list.
Using this returned usize
value as an index into the P1 entries list will give you the final PTE,
from which you can extract the mapped Frame
using PageTableEntry::pointed_frame()
.
Trait Implementations§
source§impl AddAssign<usize> for Page
impl AddAssign<usize> for Page
source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
+=
operation. Read moresource§impl Ord for Page
impl Ord for Page
source§impl PartialEq<Page> for Page
impl PartialEq<Page> for Page
source§impl PartialOrd<Page> for Page
impl PartialOrd<Page> for Page
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Step for Page
impl Step for Page
Implementing Step
allows Page
to be used in an Iterator
.
source§fn steps_between(start: &Page, end: &Page) -> Option<usize>
fn steps_between(start: &Page, end: &Page) -> Option<usize>
step_trait
)source§fn forward_checked(start: Page, count: usize) -> Option<Page>
fn forward_checked(start: Page, count: usize) -> Option<Page>
step_trait
)source§fn backward_checked(start: Page, count: usize) -> Option<Page>
fn backward_checked(start: Page, count: usize) -> Option<Page>
step_trait
)source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
step_trait
)source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
step_trait
)source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
step_trait
)source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
step_trait
)source§impl SubAssign<usize> for Page
impl SubAssign<usize> for Page
source§fn sub_assign(&mut self, rhs: usize)
fn sub_assign(&mut self, rhs: usize)
-=
operation. Read more