Enum rhai::EvalAltResult[][src]

#[non_exhaustive]
pub enum EvalAltResult {
Show 27 variants ErrorSystem(String, Box<dyn Error>), ErrorParsing(ParseErrorType, Position), ErrorVariableNotFound(String, Position), ErrorFunctionNotFound(String, Position), ErrorInFunctionCall(String, String, Box<EvalAltResult>, Position), ErrorModuleNotFound(String, Position), ErrorInModule(String, Box<EvalAltResult>, Position), ErrorUnboundThis(Position), ErrorMismatchDataType(String, String, Position), ErrorMismatchOutputType(String, String, Position), ErrorArrayBounds(usize, INT, Position), ErrorStringBounds(usize, INT, Position), ErrorBitFieldBounds(usize, INT, Position), ErrorIndexingType(String, Position), ErrorFor(Position), ErrorDataRace(String, Position), ErrorAssignmentToConstant(String, Position), ErrorDotExpr(String, Position), ErrorArithmetic(String, Position), ErrorTooManyOperations(Position), ErrorTooManyModules(Position), ErrorStackOverflow(Position), ErrorDataTooLarge(String, Position), ErrorTerminated(Dynamic, Position), ErrorRuntime(Dynamic, Position), LoopBreak(bool, Position), Return(Dynamic, Position),
}
Expand description

Evaluation result.

All wrapped Position values represent the location in the script where the error occurs.

Thread Safety

Currently, EvalAltResult is neither Send nor Sync. Turn on the sync feature to make it Send + Sync.

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

System error. Wrapped values are the error message and the internal error.

Tuple Fields of ErrorSystem

0: String1: Box<dyn Error>
ErrorParsing

Syntax error.

Tuple Fields of ErrorParsing

0: ParseErrorType1: Position
ErrorVariableNotFound

Usage of an unknown variable. Wrapped value is the variable name.

Tuple Fields of ErrorVariableNotFound

0: String1: Position
ErrorFunctionNotFound

Call to an unknown function. Wrapped value is the function signature.

Tuple Fields of ErrorFunctionNotFound

0: String1: Position
ErrorInFunctionCall

An error has occurred inside a called function. Wrapped values are the function name, function source, and the interior error.

Tuple Fields of ErrorInFunctionCall

0: String1: String2: Box<EvalAltResult>3: Position
ErrorModuleNotFound

Usage of an unknown module. Wrapped value is the module name.

Tuple Fields of ErrorModuleNotFound

0: String1: Position
ErrorInModule

An error has occurred while loading a module. Wrapped value are the module name and the interior error.

Tuple Fields of ErrorInModule

0: String1: Box<EvalAltResult>2: Position
ErrorUnboundThis

Access to this that is not bound.

Tuple Fields of ErrorUnboundThis

0: Position
ErrorMismatchDataType

Data is not of the required type. Wrapped values are the type requested and type of the actual result.

Tuple Fields of ErrorMismatchDataType

0: String1: String2: Position
ErrorMismatchOutputType

Returned type is not the same as the required output type. Wrapped values are the type requested and type of the actual result.

Tuple Fields of ErrorMismatchOutputType

0: String1: String2: Position
ErrorArrayBounds

Array access out-of-bounds. Wrapped values are the current number of elements in the array and the index number.

Tuple Fields of ErrorArrayBounds

0: usize1: INT2: Position
ErrorStringBounds

String indexing out-of-bounds. Wrapped values are the current number of characters in the string and the index number.

Tuple Fields of ErrorStringBounds

0: usize1: INT2: Position
ErrorBitFieldBounds

Bit-field indexing out-of-bounds. Wrapped values are the current number of bits in the bit-field and the index number.

Tuple Fields of ErrorBitFieldBounds

0: usize1: INT2: Position
ErrorIndexingType

Trying to index into a type that has no indexer function defined. Wrapped value is the type name.

Tuple Fields of ErrorIndexingType

0: String1: Position
ErrorFor

The for statement encounters a type that is not an iterator.

Tuple Fields of ErrorFor

0: Position
ErrorDataRace

Data race detected when accessing a variable. Wrapped value is the variable name.

Tuple Fields of ErrorDataRace

0: String1: Position
ErrorAssignmentToConstant

Assignment to a constant variable. Wrapped value is the variable name.

Tuple Fields of ErrorAssignmentToConstant

0: String1: Position
ErrorDotExpr

Inappropriate property access. Wrapped value is the property name.

Tuple Fields of ErrorDotExpr

0: String1: Position
ErrorArithmetic

Arithmetic error encountered. Wrapped value is the error message.

Tuple Fields of ErrorArithmetic

0: String1: Position
ErrorTooManyOperations

Number of operations over maximum limit.

Tuple Fields of ErrorTooManyOperations

0: Position
ErrorTooManyModules

Modules over maximum limit.

Tuple Fields of ErrorTooManyModules

0: Position
ErrorStackOverflow

Call stack over maximum limit.

Tuple Fields of ErrorStackOverflow

0: Position
ErrorDataTooLarge

Data value over maximum size limit. Wrapped value is the type name.

Tuple Fields of ErrorDataTooLarge

0: String1: Position
ErrorTerminated

The script is prematurely terminated. Wrapped value is the termination token.

Tuple Fields of ErrorTerminated

0: Dynamic1: Position
ErrorRuntime

Run-time error encountered. Wrapped value is the error token.

Tuple Fields of ErrorRuntime

0: Dynamic1: Position
LoopBreak

Breaking out of loops - not an error if within a loop. The wrapped value, if true, means breaking clean out of the loop (i.e. a break statement). The wrapped value, if false, means breaking the current context (i.e. a continue statement).

Tuple Fields of LoopBreak

0: bool1: Position
Return

Not an error: Value returned from a script via the return keyword. Wrapped value is the result value.

Tuple Fields of Return

0: Dynamic1: Position

Implementations

Is this a pseudo error? A pseudo error is one that does not occur naturally.

LoopBreak and Return are pseudo errors.

Can this error be caught?

Is this error a system exception?

Get the position of this error.

Remove the position information from this error.

The position of this error is set to NONE afterwards.

Remove the position information from this error and return it.

The position of this error is set to NONE afterwards.

Override the position of this error.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.