Skip to main content

PageTableIndex

Struct PageTableIndex 

Source
pub struct PageTableIndex(/* private fields */);
Expand description

A 9-bit index into a page table.

Can be used to select one of the 512 entries of a page table.

Guaranteed to only ever contain 0..512.

Implementations§

Source§

impl PageTableIndex

Source

pub const fn new(index: u16) -> Self

Creates a new index from the given u16. Panics if the given value is >=512.

Source

pub const fn new_truncate(index: u16) -> Self

Creates a new index from the given u16. Throws away bits if the value is >=512.

Trait Implementations§

Source§

impl Clone for PageTableIndex

Source§

fn clone(&self) -> PageTableIndex

Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PageTableIndex

Source§

impl Debug for PageTableIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PageTableIndex

Source§

impl From<PageTableIndex> for u16

Source§

fn from(index: PageTableIndex) -> Self

Converts to this type from the input type.
Source§

impl From<PageTableIndex> for u32

Source§

fn from(index: PageTableIndex) -> Self

Converts to this type from the input type.
Source§

impl From<PageTableIndex> for u64

Source§

fn from(index: PageTableIndex) -> Self

Converts to this type from the input type.
Source§

impl From<PageTableIndex> for usize

Source§

fn from(index: PageTableIndex) -> Self

Converts to this type from the input type.
Source§

impl Hash for PageTableIndex

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
Source§

impl Index<PageTableIndex> for PageTable

Source§

type Output = PageTableEntry

The returned type after indexing.
Source§

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

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

impl IndexMut<PageTableIndex> for PageTable

Source§

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

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

impl Ord for PageTableIndex

Source§

fn cmp(&self, other: &PageTableIndex) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0 (const: unstable)§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable)§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable)§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PageTableIndex

Source§

fn eq(&self, other: &PageTableIndex) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable)§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for PageTableIndex

Source§

fn partial_cmp(&self, other: &PageTableIndex) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable)§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable)§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable)§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable)§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Step for PageTableIndex

Available on crate feature step_trait only.
Source§

fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (step_trait)
Returns the bounds on the number of successor steps required to get from start to end like [Iterator::size_hint()][Iterator::size_hint()]. Read more
Source§

fn forward_checked(start: Self, count: usize) -> Option<Self>

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the successor of self count times. Read more
Source§

fn backward_checked(start: Self, count: usize) -> Option<Self>

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
Source§

fn forward_overflowing(start: Self, count: usize) -> (Self, bool)

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the successor of self count times along with a boolean tracking whether overflow occurred. Read more
Source§

fn backward_overflowing(start: Self, count: usize) -> (Self, bool)

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the successor of self count times along with a boolean tracking whether overflow occurred. Read more
§

fn forward(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the successor of self count times. Read more
§

unsafe fn forward_unchecked(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the successor of self count times. Read more
§

fn backward(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
§

unsafe fn backward_unchecked(start: Self, count: usize) -> Self

🔬This is a nightly-only experimental API. (step_trait)
Returns the value that would be obtained by taking the predecessor of self count times. Read more
Source§

impl StructuralPartialEq for PageTableIndex

Auto Trait Implementations§

§

impl Freeze for PageTableIndex

§

impl RefUnwindSafe for PageTableIndex

§

impl Send for PageTableIndex

§

impl Sync for PageTableIndex

§

impl Unpin for PageTableIndex

§

impl UnsafeUnpin for PageTableIndex

§

impl UnwindSafe for PageTableIndex

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.