Struct PageTable
#[repr(C, align(4096))]pub struct PageTable {
entries: [PageTableEntry; 512],
}Expand description
Represents a page table.
Always page-sized.
This struct implements the Index and IndexMut traits, so the entries can be accessed
through index operations. For example, page_table[15] returns the 16th page table entry.
Note that while this type implements Clone, the users must be careful not to introduce
mutable aliasing by using the cloned page tables.
Fields§
§entries: [PageTableEntry; 512]Implementations§
§impl PageTable
impl PageTable
pub fn zero(&mut self)
pub fn zero(&mut self)
Clears all entries.
pub fn iter(&self) -> impl Iterator<Item = &PageTableEntry>
pub fn iter(&self) -> impl Iterator<Item = &PageTableEntry>
Returns an iterator over the entries of the page table.
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut PageTableEntry>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut PageTableEntry>
Returns an iterator that allows modifying the entries of the page table.
Trait Implementations§
§impl Index<PageTableIndex> for PageTable
impl Index<PageTableIndex> for PageTable
§type Output = PageTableEntry
type Output = PageTableEntry
The returned type after indexing.
§fn index(
&self,
index: PageTableIndex,
) -> &<PageTable as Index<PageTableIndex>>::Output
fn index( &self, index: PageTableIndex, ) -> &<PageTable as Index<PageTableIndex>>::Output
Performs the indexing (
container[index]) operation. Read more§impl IndexMut<PageTableIndex> for PageTable
impl IndexMut<PageTableIndex> for PageTable
§fn index_mut(
&mut self,
index: PageTableIndex,
) -> &mut <PageTable as Index<PageTableIndex>>::Output
fn index_mut( &mut self, index: PageTableIndex, ) -> &mut <PageTable as Index<PageTableIndex>>::Output
Performs the mutable indexing (
container[index]) operation. Read moreAuto Trait Implementations§
impl Freeze for PageTable
impl RefUnwindSafe for PageTable
impl Send for PageTable
impl Sync for PageTable
impl Unpin for PageTable
impl UnsafeUnpin for PageTable
impl UnwindSafe for PageTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more