Struct PageTable

Source
pub struct PageTable<Meta: VmMeta> { /* private fields */ }
Expand description

页表。

不持有页表的所有权,因为页表总是在一些物理页帧上。

Implementations§

Source§

impl<Meta: VmMeta> PageTable<Meta>

Source

pub unsafe fn from_raw_parts( ptr: NonNull<Pte<Meta>>, base: VPN<Meta>, level: usize, ) -> Self

从指向第一个页表项的指针创建页表。

§Safety

from_raw_parts_mut.

Source

pub unsafe fn from_root(root: NonNull<Pte<Meta>>) -> Self

从指向根页表的指针创建页表。

§Safety

from_raw_parts_mut.

Source

pub const fn as_ptr(&self) -> *const Pte<Meta>

获取指向第一个页表项的指针。

Source

pub const fn level(&self) -> usize

获取页表级别。

Source

pub fn range(&self) -> Range<VPN<Meta>>

获取页表容纳的虚页号范围。

Source

pub fn walk(&self, target: Pos<Meta>, visitor: &mut impl Visitor<Meta>)

使用访问器 visitor 遍历页表。

Source

pub fn walk_mut( &mut self, target: Pos<Meta>, visitor: &mut impl Decorator<Meta>, )

使用访问器 visitor 遍历并修改页表。

Trait Implementations§

Source§

impl<Meta: VmMeta> Index<usize> for PageTable<Meta>

Source§

type Output = Pte<Meta>

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<Meta: VmMeta> IndexMut<usize> for PageTable<Meta>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<Meta> Freeze for PageTable<Meta>

§

impl<Meta> RefUnwindSafe for PageTable<Meta>
where Meta: RefUnwindSafe,

§

impl<Meta> Send for PageTable<Meta>
where Meta: Send,

§

impl<Meta> Sync for PageTable<Meta>
where Meta: Sync,

§

impl<Meta> Unpin for PageTable<Meta>
where Meta: Unpin,

§

impl<Meta> !UnwindSafe for PageTable<Meta>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.