Skip to main content

RuntimeErrorKind

Enum RuntimeErrorKind 

Source
#[non_exhaustive]
pub enum RuntimeErrorKind {
Show 31 variants UninitializedValue, ExpectedNonNil, UndefinedGlobal { name: String, }, MissingArgument { name: &'static str, }, TypeMismatch { expected: &'static str, actual: MiraType, }, NotCallable { actual: MiraType, }, MissingIndexOrField, ArrayLimit { requested: usize, max: usize, }, ForeignHandle, InvalidHandle { category: &'static str, }, HandleTypeMismatch { category: &'static str, }, ArenaExhausted { category: &'static str, }, ReentrantRun, InvalidControlFlow { context: &'static str, }, InvalidUpvalueLevel { level: usize, }, Timeout, MaxCallDepth { max: u32, }, EscapingClosure, ExecutionEnded, InvalidConstantKind { index: usize, expected: &'static str, }, InvalidMatrixSize, MatrixMustBeSquare, IncompatibleMatrixDimensions, InvalidIntegerArgument { name: &'static str, constraint: &'static str, }, InvalidUpdateEntryCount { actual: usize, }, InvalidDateTime, InvalidTimestamp { actual: MiraType, }, TimeOffsetOutOfRange, JsonSerialization { source: Error, }, InvalidJson { source: Error, }, UserMessage { message: String, },
}
Expand description

A VM or standard-library execution failure.

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.
§

UninitializedValue

A register was read before initialization.

§

ExpectedNonNil

A non-nil value was required.

§

UndefinedGlobal

A global variable is not defined.

Fields

§name: String

Missing name.

§

MissingArgument

An argument is required.

Fields

§name: &'static str

Argument name.

§

TypeMismatch

A value has the wrong type for an operation.

Fields

§expected: &'static str

Human-readable expected type set.

§actual: MiraType

Actual value category.

§

NotCallable

A value is not callable.

Fields

§actual: MiraType

Actual value category.

§

MissingIndexOrField

An index or field does not exist.

§

ArrayLimit

An array allocation would exceed the configured limit.

Fields

§requested: usize

Requested length.

§max: usize

Configured maximum.

§

ForeignHandle

An arena handle belongs to another runtime.

§

InvalidHandle

An arena handle is invalid for its value category.

Fields

§category: &'static str

Arena category.

§

HandleTypeMismatch

The value behind a typed handle has a different concrete Rust type.

Fields

§category: &'static str

Arena category.

§

ArenaExhausted

One arena category exhausted its 32-bit slot space.

Fields

§category: &'static str

Arena category.

§

ReentrantRun

Runtime execution was entered recursively.

§

InvalidControlFlow

Internal bytecode control flow reached an invalid boundary.

Fields

§context: &'static str

Boundary being exited.

§

InvalidUpvalueLevel

An upvalue level is invalid for the current frame.

Fields

§level: usize

Requested lexical level.

§

Timeout

Execution exceeded its time limit.

§

MaxCallDepth

Execution exceeded its call-depth limit.

Fields

§max: u32

Configured maximum call depth.

§

EscapingClosure

A script closure or script module attempted to escape a run.

§

ExecutionEnded

A script-scoped callable was used after its run ended.

§

InvalidConstantKind

Bytecode referenced a constant with an incompatible kind.

Fields

§index: usize

Constant-table index.

§expected: &'static str

Required constant kind.

§

InvalidMatrixSize

Matrix dimensions are invalid or exceed the configured limit.

§

MatrixMustBeSquare

A matrix operation requires a square matrix.

§

IncompatibleMatrixDimensions

Matrix operands have incompatible dimensions.

§

InvalidIntegerArgument

An integer-valued argument failed its domain constraint.

Fields

§name: &'static str

Argument name.

§constraint: &'static str

Required integer constraint.

§

InvalidUpdateEntryCount

The number of update entries is not valid.

Fields

§actual: usize

Actual number of entries.

§

InvalidDateTime

A datetime string could not be parsed.

§

InvalidTimestamp

A value cannot be interpreted as a timestamp.

Fields

§actual: MiraType

Actual value category.

§

TimeOffsetOutOfRange

A timezone offset is outside the supported range.

§

JsonSerialization

JSON serialization failed.

Fields

§source: Error

Serializer error.

§

InvalidJson

JSON input is invalid.

Fields

§source: Error

Parser error.

§

UserMessage

A script assertion or panic supplied a message.

Fields

§message: String

Script-provided message.

Trait Implementations§

Source§

impl Debug for RuntimeErrorKind

Source§

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

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

impl Display for RuntimeErrorKind

Source§

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

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

impl Error for RuntimeErrorKind

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.