pub enum PanicKind {
Overflow,
DivideByZero,
DecodeError,
TypeError,
DerivationError,
CapiMisuse,
Internal,
}Expand description
The classification of a runtime failure.
This is the panic effect made concrete (design §3.3): anything that
can go wrong at runtime is one of these kinds, and hosts receive it
through the C ABI as a structured error, never as an unwind.
Variants§
Overflow
Integer overflow in an arithmetic primitive.
DivideByZero
Zero divisor in integer / or %.
DecodeError
Input JSON rejected by type-directed decode.
TypeError
A value of the wrong shape reached an operation (defensive; the checker prevents this in checked code).
DerivationError
A derived operation (eq/compare/hash/show) was invoked on
a type marked non-derivable, or reached a closure.
CapiMisuse
The C ABI was used against its documented contract (undefined
TypeId, wrong arity, use after teardown).
Internal
A bug in the runtime itself, caught at the C ABI boundary.
Implementations§
Trait Implementations§
impl Copy for PanicKind
impl Eq for PanicKind
impl StructuralPartialEq for PanicKind
Auto Trait Implementations§
impl Freeze for PanicKind
impl RefUnwindSafe for PanicKind
impl Send for PanicKind
impl Sync for PanicKind
impl Unpin for PanicKind
impl UnsafeUnpin for PanicKind
impl UnwindSafe for PanicKind
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