Skip to main content

ErrorKind

Enum ErrorKind 

Source
#[non_exhaustive]
pub enum ErrorKind {
Show 19 variants Unsupported, Interrupted { receipt: u32, }, DeferredError { receipt: u32, }, Incomparable, Membership, ModuleMembership, ModuleCompare, Overflow, IntegerTooBig, DivisionByZero, NullPowerNull, Argument, TooLarge, NotEnumerable, Duplicate, NotFingerprintable, Json, Codec, DiveLimit,
}
Expand description

The class of a value-layer error.

Specification error classes map to TLC’s error codes (tlc2.output.EC), see ErrorKind::tlc_code. ErrorKind::Interrupted is instead typed host control flow; its numeric code accessor is not a TLC-error certificate.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unsupported

A mathematical operation whose exact semantics are not implemented. The numeric code accessor is not a TLC error certificate for this kind.

§

Interrupted

Typed cooperative host interruption transported through a deferred evaluator provider. This is not a TLC error or a resource refusal.

Fields

§receipt: u32

Process-unique, nonreused identity of the evaluator’s pending deferred-provider receipt. It is not a TLC error code.

§

DeferredError

An evaluator error with sealed native-cause provenance. Only its original evaluator can recover the error; message text is insufficient.

Fields

§receipt: u32

Process-unique, nonreused pending evaluator receipt.

§

Incomparable

Two values that TLC refuses to compare or to test for equality (Assert.fail in a compareTo/equals method, EC.GENERAL).

§

Membership

A membership test that TLC refuses (member methods, EC.GENERAL).

§

ModuleMembership

A membership test in an infinite built-in set refused by its module (EC.TLC_MODULE_CHECK_MEMBER_OF).

§

ModuleCompare

A comparison refused by a built-in infinite set (EC.TLC_MODULE_COMPARE_VALUE).

§

Overflow

32-bit integer overflow (EC.TLC_MODULE_OVERFLOW).

§

IntegerTooBig

An integer literal above 2^31 - 1 (EC.TLC_INTEGER_TOO_BIG).

§

DivisionByZero

\div by zero (EC.TLC_MODULE_DIVISION_BY_ZERO).

§

NullPowerNull

0^0 (EC.TLC_MODULE_NULL_POWER_NULL).

§

Argument

An argument of the wrong kind or range (EC.TLC_MODULE_ARGUMENT_ERROR).

§

TooLarge

A set too large to be represented or enumerated (EC.GENERAL).

§

NotEnumerable

A set that cannot be enumerated because it is infinite or symbolic (EC.GENERAL).

§

Duplicate

A duplicate in a function domain or a record’s fields (EC.GENERAL).

§

NotFingerprintable

A value that cannot be fingerprinted, such as Nat (EC.GENERAL).

§

Json

A value that cannot be converted to TLC’s JSON form.

§

Codec

Bytes that are not a valid value encoding (crate::codec). This is an internal error, never a property of the spec: dive only decodes what it encoded.

§

DiveLimit

A dive-only limit, such as a big-integer result too large to allocate. TLC has no counterpart (it would have overflowed long before).

Implementations§

Source§

impl ErrorKind

Source

pub const fn tlc_code(self) -> u32

The TLC EC code number TLC reports for this class.

Source

pub const fn tlc_name(self) -> &'static str

The TLC EC constant name for ErrorKind::tlc_code.

Source

pub const fn dive_code(self) -> &'static str

The stable dive error code (DIVE-Vnnnn) for this class.

Trait Implementations§

Source§

impl Clone for ErrorKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorKind

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorKind

Source§

impl Hash for ErrorKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ErrorKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.