#[repr(transparent)]pub struct PageFaultError(u32);
Expand description
Error code for page faults
Tuple Fields§
§0: u32
Implementations§
source§impl PageFaultError
impl PageFaultError
const PROTECTION_BITS: usize = 1usize
const PROTECTION_OFFSET: usize = 0usize
const WRITE_BITS: usize = 1usize
const WRITE_OFFSET: usize = 1usize
const USER_BITS: usize = 1usize
const USER_OFFSET: usize = 2usize
const TABLE_BITS: usize = 1usize
const TABLE_OFFSET: usize = 3usize
const INSTRUCTION_BITS: usize = 1usize
const INSTRUCTION_OFFSET: usize = 4usize
sourcepub const fn protection(&self) -> bool
pub const fn protection(&self) -> bool
If this flag is set, the page fault was caused by a page-protection violation, else the page fault was caused by a not-present page.
Bits: 0..1
sourcepub const fn with_protection_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_protection_checked(self, value: bool) -> Result<Self, ()>
If this flag is set, the page fault was caused by a page-protection violation, else the page fault was caused by a not-present page.
Bits: 0..1
sourcepub const fn with_protection(self, value: bool) -> Self
pub const fn with_protection(self, value: bool) -> Self
If this flag is set, the page fault was caused by a page-protection violation, else the page fault was caused by a not-present page.
Bits: 0..1
sourcepub fn set_protection(&mut self, value: bool)
pub fn set_protection(&mut self, value: bool)
If this flag is set, the page fault was caused by a page-protection violation, else the page fault was caused by a not-present page.
Bits: 0..1
sourcepub fn set_protection_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_protection_checked(&mut self, value: bool) -> Result<(), ()>
If this flag is set, the page fault was caused by a page-protection violation, else the page fault was caused by a not-present page.
Bits: 0..1
sourcepub const fn write(&self) -> bool
pub const fn write(&self) -> bool
If this flag is set, the memory access that caused the page fault was a write. Else the access that caused the page fault is a memory read. This bit does not necessarily indicate the cause of the page fault was a read or write violation.
Bits: 1..2
sourcepub const fn with_write_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_write_checked(self, value: bool) -> Result<Self, ()>
If this flag is set, the memory access that caused the page fault was a write. Else the access that caused the page fault is a memory read. This bit does not necessarily indicate the cause of the page fault was a read or write violation.
Bits: 1..2
sourcepub const fn with_write(self, value: bool) -> Self
pub const fn with_write(self, value: bool) -> Self
If this flag is set, the memory access that caused the page fault was a write. Else the access that caused the page fault is a memory read. This bit does not necessarily indicate the cause of the page fault was a read or write violation.
Bits: 1..2
sourcepub fn set_write(&mut self, value: bool)
pub fn set_write(&mut self, value: bool)
If this flag is set, the memory access that caused the page fault was a write. Else the access that caused the page fault is a memory read. This bit does not necessarily indicate the cause of the page fault was a read or write violation.
Bits: 1..2
sourcepub fn set_write_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_write_checked(&mut self, value: bool) -> Result<(), ()>
If this flag is set, the memory access that caused the page fault was a write. Else the access that caused the page fault is a memory read. This bit does not necessarily indicate the cause of the page fault was a read or write violation.
Bits: 1..2
sourcepub const fn user(&self) -> bool
pub const fn user(&self) -> bool
If this flag is set, an access in user mode (CPL=3) caused the page fault. Else an access in supervisor mode (CPL=0, 1, or 2) caused the page fault. This bit does not necessarily indicate the cause of the page fault was a privilege violation.
Bits: 2..3
sourcepub const fn with_user_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_user_checked(self, value: bool) -> Result<Self, ()>
If this flag is set, an access in user mode (CPL=3) caused the page fault. Else an access in supervisor mode (CPL=0, 1, or 2) caused the page fault. This bit does not necessarily indicate the cause of the page fault was a privilege violation.
Bits: 2..3
sourcepub const fn with_user(self, value: bool) -> Self
pub const fn with_user(self, value: bool) -> Self
If this flag is set, an access in user mode (CPL=3) caused the page fault. Else an access in supervisor mode (CPL=0, 1, or 2) caused the page fault. This bit does not necessarily indicate the cause of the page fault was a privilege violation.
Bits: 2..3
sourcepub fn set_user(&mut self, value: bool)
pub fn set_user(&mut self, value: bool)
If this flag is set, an access in user mode (CPL=3) caused the page fault. Else an access in supervisor mode (CPL=0, 1, or 2) caused the page fault. This bit does not necessarily indicate the cause of the page fault was a privilege violation.
Bits: 2..3
sourcepub fn set_user_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_user_checked(&mut self, value: bool) -> Result<(), ()>
If this flag is set, an access in user mode (CPL=3) caused the page fault. Else an access in supervisor mode (CPL=0, 1, or 2) caused the page fault. This bit does not necessarily indicate the cause of the page fault was a privilege violation.
Bits: 2..3
sourcepub const fn table(&self) -> bool
pub const fn table(&self) -> bool
If this flag is set, the page fault is a result of the processor reading a 1 from a reserved field within a page-translation-table entry.
Bits: 3..4
sourcepub const fn with_table_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_table_checked(self, value: bool) -> Result<Self, ()>
If this flag is set, the page fault is a result of the processor reading a 1 from a reserved field within a page-translation-table entry.
Bits: 3..4
sourcepub const fn with_table(self, value: bool) -> Self
pub const fn with_table(self, value: bool) -> Self
If this flag is set, the page fault is a result of the processor reading a 1 from a reserved field within a page-translation-table entry.
Bits: 3..4
sourcepub fn set_table(&mut self, value: bool)
pub fn set_table(&mut self, value: bool)
If this flag is set, the page fault is a result of the processor reading a 1 from a reserved field within a page-translation-table entry.
Bits: 3..4
sourcepub fn set_table_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_table_checked(&mut self, value: bool) -> Result<(), ()>
If this flag is set, the page fault is a result of the processor reading a 1 from a reserved field within a page-translation-table entry.
Bits: 3..4
sourcepub const fn instruction(&self) -> bool
pub const fn instruction(&self) -> bool
If this flag is set, it indicates that the access that caused the page fault was an instruction fetch.
Bits: 4..5
sourcepub const fn with_instruction_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_instruction_checked(self, value: bool) -> Result<Self, ()>
If this flag is set, it indicates that the access that caused the page fault was an instruction fetch.
Bits: 4..5
sourcepub const fn with_instruction(self, value: bool) -> Self
pub const fn with_instruction(self, value: bool) -> Self
If this flag is set, it indicates that the access that caused the page fault was an instruction fetch.
Bits: 4..5
sourcepub fn set_instruction(&mut self, value: bool)
pub fn set_instruction(&mut self, value: bool)
If this flag is set, it indicates that the access that caused the page fault was an instruction fetch.
Bits: 4..5
sourcepub fn set_instruction_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_instruction_checked(&mut self, value: bool) -> Result<(), ()>
If this flag is set, it indicates that the access that caused the page fault was an instruction fetch.
Bits: 4..5
Trait Implementations§
source§impl Clone for PageFaultError
impl Clone for PageFaultError
source§fn clone(&self) -> PageFaultError
fn clone(&self) -> PageFaultError
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PageFaultError
impl Debug for PageFaultError
source§impl Default for PageFaultError
impl Default for PageFaultError
source§impl From<PageFaultError> for u32
impl From<PageFaultError> for u32
source§fn from(v: PageFaultError) -> u32
fn from(v: PageFaultError) -> u32
source§impl From<u32> for PageFaultError
impl From<u32> for PageFaultError
impl Copy for PageFaultError
Auto Trait Implementations§
impl Freeze for PageFaultError
impl RefUnwindSafe for PageFaultError
impl Send for PageFaultError
impl Sync for PageFaultError
impl Unpin for PageFaultError
impl UnwindSafe for PageFaultError
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)