#[repr(u32)]pub enum TrapCode {
StackOverflow = 0,
HeapAccessOutOfBounds = 1,
HeapMisaligned = 2,
TableAccessOutOfBounds = 3,
IndirectCallToNull = 4,
BadSignature = 5,
IntegerOverflow = 6,
IntegerDivisionByZero = 7,
BadConversionToInteger = 8,
UnreachableCodeReached = 9,
UnalignedAtomic = 10,
}
Expand description
A trap code describing the reason for a trap.
All trap instructions have an explicit trap code.
Variants§
StackOverflow = 0
The current stack space was exhausted.
On some platforms, a stack overflow may also be indicated by a segmentation fault from the stack guard page.
HeapAccessOutOfBounds = 1
A heap_addr
instruction detected an out-of-bounds error.
Note that not all out-of-bounds heap accesses are reported this way; some are detected by a segmentation fault on the heap unmapped or offset-guard pages.
HeapMisaligned = 2
A heap_addr
instruction was misaligned.
TableAccessOutOfBounds = 3
A table_addr
instruction detected an out-of-bounds error.
IndirectCallToNull = 4
Indirect call to a null table entry.
BadSignature = 5
Signature mismatch on indirect call.
IntegerOverflow = 6
An integer arithmetic operation caused an overflow.
IntegerDivisionByZero = 7
An integer division by zero.
BadConversionToInteger = 8
Failed float-to-int conversion.
UnreachableCodeReached = 9
Code that was supposed to have been unreachable was reached.
UnalignedAtomic = 10
An atomic memory access was attempted with an unaligned pointer.
Implementations§
Trait Implementations§
Source§impl Archive for TrapCode
impl Archive for TrapCode
Source§type Resolver = TrapCodeResolver
type Resolver = TrapCodeResolver
Source§fn resolve(
&self,
resolver: <TrapCode as Archive>::Resolver,
out: Place<<TrapCode as Archive>::Archived>,
)
fn resolve( &self, resolver: <TrapCode as Archive>::Resolver, out: Place<<TrapCode as Archive>::Archived>, )
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize
. Read moreSource§impl Error for TrapCode
impl Error for TrapCode
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
impl Copy for TrapCode
impl Eq for TrapCode
impl StructuralPartialEq for TrapCode
Auto Trait Implementations§
impl Freeze for TrapCode
impl RefUnwindSafe for TrapCode
impl Send for TrapCode
impl Sync for TrapCode
impl Unpin for TrapCode
impl UnwindSafe for TrapCode
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.