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
impl PageTableIndex
Sourcepub const fn new(index: u16) -> Self
pub const fn new(index: u16) -> Self
Creates a new index from the given u16. Panics if the given value is >=512.
Sourcepub const fn new_truncate(index: u16) -> Self
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
impl Clone for PageTableIndex
Source§fn clone(&self) -> PageTableIndex
fn clone(&self) -> PageTableIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PageTableIndex
Source§impl Debug for PageTableIndex
impl Debug for PageTableIndex
impl Eq for PageTableIndex
Source§impl From<PageTableIndex> for u16
impl From<PageTableIndex> for u16
Source§fn from(index: PageTableIndex) -> Self
fn from(index: PageTableIndex) -> Self
Converts to this type from the input type.
Source§impl From<PageTableIndex> for u32
impl From<PageTableIndex> for u32
Source§fn from(index: PageTableIndex) -> Self
fn from(index: PageTableIndex) -> Self
Converts to this type from the input type.
Source§impl From<PageTableIndex> for u64
impl From<PageTableIndex> for u64
Source§fn from(index: PageTableIndex) -> Self
fn from(index: PageTableIndex) -> Self
Converts to this type from the input type.
Source§impl From<PageTableIndex> for usize
impl From<PageTableIndex> for usize
Source§fn from(index: PageTableIndex) -> Self
fn from(index: PageTableIndex) -> Self
Converts to this type from the input type.
Source§impl Hash for PageTableIndex
impl Hash for PageTableIndex
Source§impl Index<PageTableIndex> for PageTable
impl Index<PageTableIndex> for PageTable
Source§type Output = PageTableEntry
type Output = PageTableEntry
The returned type after indexing.
Source§fn index(&self, index: PageTableIndex) -> &Self::Output
fn index(&self, index: PageTableIndex) -> &Self::Output
Performs the indexing (
container[index]) operation. Read moreSource§impl IndexMut<PageTableIndex> for PageTable
impl IndexMut<PageTableIndex> for PageTable
Source§fn index_mut(&mut self, index: PageTableIndex) -> &mut Self::Output
fn index_mut(&mut self, index: PageTableIndex) -> &mut Self::Output
Performs the mutable indexing (
container[index]) operation. Read moreSource§impl Ord for PageTableIndex
impl Ord for PageTableIndex
Source§fn cmp(&self, other: &PageTableIndex) -> Ordering
fn cmp(&self, other: &PageTableIndex) -> Ordering
1.21.0 (const: unstable)§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
Source§impl PartialEq for PageTableIndex
impl PartialEq for PageTableIndex
Source§impl PartialOrd for PageTableIndex
impl PartialOrd for PageTableIndex
Source§impl Step for PageTableIndex
Available on crate feature step_trait only.
impl Step for PageTableIndex
Available on crate feature
step_trait only.Source§fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>)
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 moreSource§fn forward_checked(start: Self, count: usize) -> Option<Self>
fn forward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn backward_checked(start: Self, count: usize) -> Option<Self>
fn backward_checked(start: Self, count: usize) -> Option<Self>
🔬This is a nightly-only experimental API. (
step_trait)Source§fn forward_overflowing(start: Self, count: usize) -> (Self, bool)
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 moreSource§fn backward_overflowing(start: Self, count: usize) -> (Self, bool)
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
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§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)§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait)§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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)