pub enum Trap {
IllegalInstruction {
pc: i64,
cause: DecodeError,
},
Memory {
pc: i64,
cause: MemoryError,
},
DivideByZero {
pc: i64,
},
Overflow {
pc: i64,
op: Opcode,
},
PcOutOfRange {
pc: i64,
},
Ecall {
pc: i64,
},
Privilege {
pc: i64,
needed: Priv,
},
PageFault {
pc: i64,
addr: i64,
},
StepLimit {
pc: i64,
steps: u64,
},
}Expand description
Something stopped execution.
Variants§
IllegalInstruction
The word at pc is not a valid instruction.
Memory
A memory access failed.
DivideByZero
Division or remainder by zero.
Overflow
A result left the 27-trit range.
PcOutOfRange
Control flow left the address space.
Ecall
An ecall. Not a fault: the deliberate way into the operating system.
Privilege
An instruction needed a privilege the machine was not at.
PageFault
Address translation failed.
StepLimit
Cpu::run reached its step budget without halting.
Trait Implementations§
impl Copy for Trap
impl Eq for Trap
Source§impl Error for Trap
impl Error for Trap
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Trap
Auto Trait Implementations§
impl Freeze for Trap
impl RefUnwindSafe for Trap
impl Send for Trap
impl Sync for Trap
impl Unpin for Trap
impl UnsafeUnpin for Trap
impl UnwindSafe for Trap
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