Enum rhai::EvalAltResult [−][src]
#[non_exhaustive]
pub enum EvalAltResult {
Show 28 variants
ErrorParsing(ParseErrorType, Position),
ErrorReadingScriptFile(PathBuf, Position, Error),
ErrorVariableNotFound(String, Position),
ErrorFunctionNotFound(String, Position),
ErrorInFunctionCall(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),
ErrorIndexingType(String, Position),
ErrorInExpr(Position),
ErrorFor(Position),
ErrorDataRace(String, Position),
ErrorAssignmentToUnknownLHS(Position),
ErrorAssignmentToConstant(String, Position),
ErrorDotExpr(String, Position),
ErrorArithmetic(String, Position),
ErrorTooManyOperations(Position),
ErrorTooManyModules(Position),
ErrorStackOverflow(Position),
ErrorDataTooLarge(String, usize, usize, Position),
ErrorTerminated(Position),
ErrorRuntime(String, Position),
ErrorLoopBreak(bool, Position),
Return(Dynamic, Position),
}
Expand description
Evaluation result.
All wrapped Position
values represent the location in the script where the error occurs.
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
ErrorParsing(ParseErrorType, Position)
Syntax error.
ErrorReadingScriptFile(PathBuf, Position, Error)
Error reading from a script file. Wrapped value is the path of the script file.
Never appears under the no_std
feature.
ErrorVariableNotFound(String, Position)
Usage of an unknown variable. Wrapped value is the variable name.
ErrorFunctionNotFound(String, Position)
Call to an unknown function. Wrapped value is the function signature.
ErrorInFunctionCall(String, Box<EvalAltResult>, Position)
An error has occurred inside a called function. Wrapped values are the function name and the interior error.
ErrorModuleNotFound(String, Position)
Usage of an unknown module. Wrapped value is the module name.
ErrorInModule(String, Box<EvalAltResult>, Position)
An error has occurred while loading a module. Wrapped value are the module name and the interior error.
ErrorUnboundThis(Position)
Tuple Fields
0: Position
Access to this
that is not bound.
ErrorMismatchDataType(String, String, Position)
Data is not of the required type. Wrapped values are the type requested and type of the actual result.
ErrorMismatchOutputType(String, String, Position)
Returned type is not the same as the required output type. Wrapped values are the type requested and type of the actual result.
ErrorArrayBounds(usize, INT, Position)
Array access out-of-bounds. Wrapped values are the current number of elements in the array and the index number.
ErrorStringBounds(usize, INT, Position)
String indexing out-of-bounds. Wrapped values are the current number of characters in the string and the index number.
ErrorIndexingType(String, Position)
Trying to index into a type that is not an array, an object map, or a string, and has no indexer function defined. Wrapped value is the type name.
ErrorInExpr(Position)
Tuple Fields
0: Position
Invalid arguments for in
operator.
ErrorFor(Position)
Tuple Fields
0: Position
The for
statement encounters a type that is not an iterator.
ErrorDataRace(String, Position)
Data race detected when accessing a variable. Wrapped value is the variable name.
ErrorAssignmentToUnknownLHS(Position)
Tuple Fields
0: Position
Assignment to an inappropriate LHS (left-hand-side) expression.
ErrorAssignmentToConstant(String, Position)
Assignment to a constant variable. Wrapped value is the variable name.
ErrorDotExpr(String, Position)
Inappropriate property access. Wrapped value is the property name.
ErrorArithmetic(String, Position)
Arithmetic error encountered. Wrapped value is the error message.
ErrorTooManyOperations(Position)
Tuple Fields
0: Position
Number of operations over maximum limit.
ErrorTooManyModules(Position)
Tuple Fields
0: Position
Modules over maximum limit.
ErrorStackOverflow(Position)
Tuple Fields
0: Position
Call stack over maximum limit.
ErrorDataTooLarge(String, usize, usize, Position)
Data value over maximum size limit. Wrapped values are the type name, maximum size and current size.
ErrorTerminated(Position)
Tuple Fields
0: Position
The script is prematurely terminated.
ErrorRuntime(String, Position)
Run-time error encountered. Wrapped value is the error message.
ErrorLoopBreak(bool, Position)
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).
Return(Dynamic, Position)
Not an error: Value returned from a script via the return
keyword.
Wrapped value is the result value.
Implementations
Trait Implementations
Performs the conversion.