Struct PageTableIndex
pub struct PageTableIndex(u16);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.
Tuple Fields§
§0: u16Implementations§
§impl PageTableIndex
impl PageTableIndex
pub const fn new(index: u16) -> PageTableIndex
pub const fn new(index: u16) -> PageTableIndex
Creates a new index from the given u16. Panics if the given value is >=512.
pub const fn new_truncate(index: u16) -> PageTableIndex
pub const fn new_truncate(index: u16) -> PageTableIndex
Creates a new index from the given u16. Throws away bits if the value is >=512.
Trait Implementations§
§impl Clone for PageTableIndex
impl Clone for PageTableIndex
§fn clone(&self) -> PageTableIndex
fn clone(&self) -> PageTableIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PageTableIndex
§impl Debug for PageTableIndex
impl Debug for PageTableIndex
impl Eq for PageTableIndex
§impl Hash for PageTableIndex
impl Hash for PageTableIndex
§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 more§impl Ord for PageTableIndex
impl Ord for PageTableIndex
§fn cmp(&self, other: &PageTableIndex) -> Ordering
fn cmp(&self, other: &PageTableIndex) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§impl PartialEq for PageTableIndex
impl PartialEq for PageTableIndex
§impl PartialOrd for PageTableIndex
impl PartialOrd for PageTableIndex
§impl Step for PageTableIndex
Available on crate feature step_trait only.
impl Step for PageTableIndex
Available on crate feature
step_trait only.§fn steps_between(
start: &PageTableIndex,
end: &PageTableIndex,
) -> (usize, Option<usize>)
fn steps_between( start: &PageTableIndex, end: &PageTableIndex, ) -> (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(). Read more§fn forward_checked(
start: PageTableIndex,
count: usize,
) -> Option<PageTableIndex>
fn forward_checked( start: PageTableIndex, count: usize, ) -> Option<PageTableIndex>
🔬This is a nightly-only experimental API. (
step_trait)§fn backward_checked(
start: PageTableIndex,
count: usize,
) -> Option<PageTableIndex>
fn backward_checked( start: PageTableIndex, count: usize, ) -> Option<PageTableIndex>
🔬This is a nightly-only experimental API. (
step_trait)§fn forward_overflowing(
start: PageTableIndex,
count: usize,
) -> (PageTableIndex, bool)
fn forward_overflowing( start: PageTableIndex, count: usize, ) -> (PageTableIndex, 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 backward_overflowing(
start: PageTableIndex,
count: usize,
) -> (PageTableIndex, bool)
fn backward_overflowing( start: PageTableIndex, count: usize, ) -> (PageTableIndex, 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 moreSource§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)Source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)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§
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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