#[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§
§impl Archive for TrapCode
impl Archive for TrapCode
§type Resolver = TrapCodeResolver
type Resolver = TrapCodeResolver
§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>, )
§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize
. Read more§impl<'de> Deserialize<'de> for TrapCode
impl<'de> Deserialize<'de> for TrapCode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrapCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrapCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<__D> Deserialize<TrapCode, __D> for <TrapCode as Archive>::Archivedwhere
__D: Fallible + ?Sized,
impl<__D> Deserialize<TrapCode, __D> for <TrapCode as Archive>::Archivedwhere
__D: Fallible + ?Sized,
§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<TrapCode, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<TrapCode, <__D as Fallible>::Error>
§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 PartialEq<ArchivedTrapCode> for TrapCode
impl PartialEq<ArchivedTrapCode> for TrapCode
§impl Serialize for TrapCode
impl Serialize for TrapCode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be
unsized. Read more§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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.