#[repr(i64)]pub enum Cause {
IllegalInstruction = 1,
Memory = 2,
DivideByZero = 3,
Overflow = 4,
PcOutOfRange = 5,
Ecall = 6,
PrivilegeViolation = 7,
PageFault = 8,
TimerInterrupt = 9,
ConsoleInterrupt = 10,
}Expand description
Why a trap was taken.
Causes are positive so that zero means “no trap”, which is the state a freshly reset machine is in.
Variants§
IllegalInstruction = 1
The word at pc did not decode.
Memory = 2
A load or store failed. tval carries the address.
DivideByZero = 3
div or rem by zero.
Overflow = 4
An arithmetic result left the word range.
PcOutOfRange = 5
Control flow left the address space.
Ecall = 6
An ecall. The system-call door.
PrivilegeViolation = 7
An instruction needed a privilege the machine was not at. tval
carries the level that was required.
PageFault = 8
Address translation failed. tval carries the virtual address.
TimerInterrupt = 9
The timer reached its compare value.
ConsoleInterrupt = 10
A device has input waiting.
Implementations§
Trait Implementations§
impl Copy for Cause
impl Eq for Cause
impl StructuralPartialEq for Cause
Auto Trait Implementations§
impl Freeze for Cause
impl RefUnwindSafe for Cause
impl Send for Cause
impl Sync for Cause
impl Unpin for Cause
impl UnsafeUnpin for Cause
impl UnwindSafe for Cause
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