Struct x86_64::structures::paging::Page [−][src]
A virtual memory page.
Methods
impl<S: PageSize> Page<S>
[src]
impl<S: PageSize> Page<S>
pub fn from_start_address(address: VirtAddr) -> Result<Self, ()>
[src]
pub fn from_start_address(address: VirtAddr) -> Result<Self, ()>
Returns the page that starts at the given virtual address.
Returns an error if the address is not correctly aligned (i.e. is not a valid page start).
pub fn containing_address(address: VirtAddr) -> Self
[src]
pub fn containing_address(address: VirtAddr) -> Self
Returns the page that contains the given virtual address.
pub fn start_address(&self) -> VirtAddr
[src]
pub fn start_address(&self) -> VirtAddr
Returns the start address of the page.
pub const fn size(&self) -> u64
[src]
pub const fn size(&self) -> u64
Returns the size the page (4KB, 2MB or 1GB).
pub fn p4_index(&self) -> u9
[src]
pub fn p4_index(&self) -> u9
Returns the level 4 page table index of this page.
pub fn p3_index(&self) -> u9
[src]
pub fn p3_index(&self) -> u9
Returns the level 3 page table index of this page.
ⓘImportant traits for PageRange<S>pub fn range(start: Self, end: Self) -> PageRange<S>
[src]
pub fn range(start: Self, end: Self) -> PageRange<S>
Returns a range of pages, exclusive end
.
ⓘImportant traits for PageRangeInclusive<S>pub fn range_inclusive(start: Self, end: Self) -> PageRangeInclusive<S>
[src]
pub fn range_inclusive(start: Self, end: Self) -> PageRangeInclusive<S>
Returns a range of pages, inclusive end
.
impl<S: NotGiantPageSize> Page<S>
[src]
impl<S: NotGiantPageSize> Page<S>
impl Page<Size1GiB>
[src]
impl Page<Size1GiB>
pub fn from_page_table_indices_1gib(p4_index: u9, p3_index: u9) -> Self
[src]
pub fn from_page_table_indices_1gib(p4_index: u9, p3_index: u9) -> Self
Returns the 1GiB memory page with the specified page table indices.
impl Page<Size2MiB>
[src]
impl Page<Size2MiB>
pub fn from_page_table_indices_2mib(
p4_index: u9,
p3_index: u9,
p2_index: u9
) -> Self
[src]
pub fn from_page_table_indices_2mib(
p4_index: u9,
p3_index: u9,
p2_index: u9
) -> Self
Returns the 2MiB memory page with the specified page table indices.
impl Page<Size4KiB>
[src]
impl Page<Size4KiB>
pub fn from_page_table_indices(
p4_index: u9,
p3_index: u9,
p2_index: u9,
p1_index: u9
) -> Self
[src]
pub fn from_page_table_indices(
p4_index: u9,
p3_index: u9,
p2_index: u9,
p1_index: u9
) -> Self
Returns the 4KiB memory page with the specified page table indices.
pub fn p1_index(&self) -> u9
[src]
pub fn p1_index(&self) -> u9
Returns the level 1 page table index of this page.
Trait Implementations
impl<S: Clone + PageSize> Clone for Page<S>
[src]
impl<S: Clone + PageSize> Clone for Page<S>
fn clone(&self) -> Page<S>
[src]
fn clone(&self) -> Page<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: Copy + PageSize> Copy for Page<S>
[src]
impl<S: Copy + PageSize> Copy for Page<S>
impl<S: PartialEq + PageSize> PartialEq for Page<S>
[src]
impl<S: PartialEq + PageSize> PartialEq for Page<S>
fn eq(&self, other: &Page<S>) -> bool
[src]
fn eq(&self, other: &Page<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Page<S>) -> bool
[src]
fn ne(&self, other: &Page<S>) -> bool
This method tests for !=
.
impl<S: Eq + PageSize> Eq for Page<S>
[src]
impl<S: Eq + PageSize> Eq for Page<S>
impl<S: PartialOrd + PageSize> PartialOrd for Page<S>
[src]
impl<S: PartialOrd + PageSize> PartialOrd for Page<S>
fn partial_cmp(&self, other: &Page<S>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Page<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Page<S>) -> bool
[src]
fn lt(&self, other: &Page<S>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Page<S>) -> bool
[src]
fn le(&self, other: &Page<S>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Page<S>) -> bool
[src]
fn gt(&self, other: &Page<S>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Page<S>) -> bool
[src]
fn ge(&self, other: &Page<S>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<S: Ord + PageSize> Ord for Page<S>
[src]
impl<S: Ord + PageSize> Ord for Page<S>
fn cmp(&self, other: &Page<S>) -> Ordering
[src]
fn cmp(&self, other: &Page<S>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<S: PageSize> Debug for Page<S>
[src]
impl<S: PageSize> Debug for Page<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PageSize> Add<u64> for Page<S>
[src]
impl<S: PageSize> Add<u64> for Page<S>
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Self::Output
[src]
fn add(self, rhs: u64) -> Self::Output
Performs the +
operation.
impl<S: PageSize> AddAssign<u64> for Page<S>
[src]
impl<S: PageSize> AddAssign<u64> for Page<S>
fn add_assign(&mut self, rhs: u64)
[src]
fn add_assign(&mut self, rhs: u64)
Performs the +=
operation.
impl<S: PageSize> Sub<u64> for Page<S>
[src]
impl<S: PageSize> Sub<u64> for Page<S>
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: u64) -> Self::Output
[src]
fn sub(self, rhs: u64) -> Self::Output
Performs the -
operation.
impl<S: PageSize> SubAssign<u64> for Page<S>
[src]
impl<S: PageSize> SubAssign<u64> for Page<S>
fn sub_assign(&mut self, rhs: u64)
[src]
fn sub_assign(&mut self, rhs: u64)
Performs the -=
operation.
impl<S: PageSize> Sub<Self> for Page<S>
[src]
impl<S: PageSize> Sub<Self> for Page<S>