[][src]Enum rhai::EvalAltResult

#[non_exhaustive]pub enum EvalAltResult {
    ErrorParsing(ParseErrorTypePosition),
    ErrorReadingScriptFile(PathBufPositionError),
    ErrorVariableNotFound(StringPosition),
    ErrorFunctionNotFound(StringPosition),
    ErrorInFunctionCall(StringBox<EvalAltResult>, Position),
    ErrorModuleNotFound(StringPosition),
    ErrorInModule(StringBox<EvalAltResult>, Position),
    ErrorUnboundThis(Position),
    ErrorMismatchDataType(StringStringPosition),
    ErrorMismatchOutputType(StringStringPosition),
    ErrorArrayBounds(usizeINTPosition),
    ErrorStringBounds(usizeINTPosition),
    ErrorIndexingType(StringPosition),
    ErrorInExpr(Position),
    ErrorFor(Position),
    ErrorDataRace(StringPosition),
    ErrorAssignmentToUnknownLHS(Position),
    ErrorAssignmentToConstant(StringPosition),
    ErrorDotExpr(StringPosition),
    ErrorArithmetic(StringPosition),
    ErrorTooManyOperations(Position),
    ErrorTooManyModules(Position),
    ErrorStackOverflow(Position),
    ErrorDataTooLarge(StringusizeusizePosition),
    ErrorTerminated(Position),
    ErrorRuntime(StringPosition),
    ErrorLoopBreak(boolPosition),
    Return(DynamicPosition),
}

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)

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.
ErrorParsing(ParseErrorTypePosition)

Syntax error.

ErrorReadingScriptFile(PathBufPositionError)

Error reading from a script file. Wrapped value is the path of the script file.

Never appears under the no_std feature.

ErrorVariableNotFound(StringPosition)

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

ErrorFunctionNotFound(StringPosition)

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

ErrorInFunctionCall(StringBox<EvalAltResult>, Position)

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

ErrorModuleNotFound(StringPosition)

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

ErrorInModule(StringBox<EvalAltResult>, Position)

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

ErrorUnboundThis(Position)

Access to this that is not bound.

ErrorMismatchDataType(StringStringPosition)

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

ErrorMismatchOutputType(StringStringPosition)

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

ErrorArrayBounds(usizeINTPosition)

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

ErrorStringBounds(usizeINTPosition)

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

ErrorIndexingType(StringPosition)

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)

Invalid arguments for in operator.

ErrorFor(Position)

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

ErrorDataRace(StringPosition)

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

ErrorAssignmentToUnknownLHS(Position)

Assignment to an inappropriate LHS (left-hand-side) expression.

ErrorAssignmentToConstant(StringPosition)

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

ErrorDotExpr(StringPosition)

Inappropriate property access. Wrapped value is the property name.

ErrorArithmetic(StringPosition)

Arithmetic error encountered. Wrapped value is the error message.

ErrorTooManyOperations(Position)

Number of operations over maximum limit.

ErrorTooManyModules(Position)

Modules over maximum limit.

ErrorStackOverflow(Position)

Call stack over maximum limit.

ErrorDataTooLarge(StringusizeusizePosition)

Data value over maximum size limit. Wrapped values are the type name, maximum size and current size.

ErrorTerminated(Position)

The script is prematurely terminated.

ErrorRuntime(StringPosition)

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

ErrorLoopBreak(boolPosition)

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(DynamicPosition)

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

Implementations

impl EvalAltResult[src]

pub fn position(&self) -> Position[src]

Get the Position of this error.

pub fn set_position(&mut self, new_position: Position)[src]

Override the Position of this error.

Trait Implementations

impl Debug for EvalAltResult[src]

impl Display for EvalAltResult[src]

impl Error for EvalAltResult[src]

impl<T> From<EvalAltResult> for Result<T, Box<EvalAltResult>>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.