#[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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.