EvalError

Enum EvalError 

Source
pub enum EvalError {
Show 52 variants Todo(String), ListIndexOutOfBounds { index: usize, len: usize, }, TypeMismatch { id: Identifier, expected: Type, found: Type, }, ArrayElementsDifferentTypes(TypeList), SymbolNotFound(QualifiedName), NoSymbolsToUse(QualifiedName), SymbolFound(QualifiedName), SymbolCannotBeCalled(QualifiedName, Box<SymbolDefinition>), AmbiguousSymbol { ambiguous: QualifiedName, others: Symbols, }, LocalNotFound(Identifier), PropertyNotFound(Identifier), ArgumentCountMismatch { args: ArgumentValueList, expected: usize, found: usize, }, AssertWrongSignature(ArgumentValueList), InvalidArgumentType(Type), UnexpectedArgument(Identifier, Type), AssertionFailed(String), ExpectedType { expected: Type, found: Type, }, ErrorLimitReached(u32), LocalStackEmpty(Identifier), WrongStackFrame(Identifier, &'static str), ValueError(ValueError), UnknownMethod(QualifiedName), ParseError(ParseError), StatementNotSupported(&'static str), UninitializedProperties(IdentifierList), UnexpectedNested(&'static str, Identifier), NoVariablesAllowedIn(&'static str), AttributeError(AttributeError), MissingArguments(IdentifierList), TooManyArguments(IdentifierList), BuiltinError(String), ParameterByTypeNotFound(Type), MultiplicityNotAllowed(IdentifierList), CannotMixGeometry, IfConditionIsNotBool(Value), NoInitializationFound(Identifier), BuildingPlanIncomplete(IdentifierList), EmptyModelExpression, WorkbenchInvalidOutput(WorkbenchKind, OutputType, OutputType), WorkbenchNoOutput(WorkbenchKind, OutputType), InvalidSelfReference(Identifier), ResolveError(ResolveError), NotAnOperation(QualifiedName), OperationOnEmptyGeometry, CannotCallOperationWithoutWorkpiece, MissingReturn(QualifiedName), NoModelInWorkbench, AmbiguousProperty(QualifiedName, Identifier), ValueAlreadyInitialized(Identifier, Value, SrcRef), NotAnLValue(Identifier), SymbolIsPrivate { what: QualifiedName, within: QualifiedName, }, SymbolBehindAliasIsPrivate { what: QualifiedName, alias: QualifiedName, within: QualifiedName, },
}
Expand description

Evaluation error.

Variants§

§

Todo(String)

Can’t find a project file by it’s qualified name.

§

ListIndexOutOfBounds

List index out of bounds.

Fields

§index: usize

Wrong index

§len: usize

Length of list

§

TypeMismatch

Parameter type mismatch.

Fields

§id: Identifier

Parameter name

§expected: Type

Expected type

§found: Type

Found type

§

ArrayElementsDifferentTypes(TypeList)

Array elements have different types.

§

SymbolNotFound(QualifiedName)

Symbol not found.

§

NoSymbolsToUse(QualifiedName)

Given symbol has not children which can be used.

§

SymbolFound(QualifiedName)

Symbol was not expected to be found (e.g. assert_invalid).

§

SymbolCannotBeCalled(QualifiedName, Box<SymbolDefinition>)

The symbol cannot be called, e.g. when it is a source file or a module.

§

AmbiguousSymbol

Found ambiguous symbols.

Fields

§ambiguous: QualifiedName

Searched name

§others: Symbols

Symbols which matches the name

§

LocalNotFound(Identifier)

Local Symbol not found.

§

PropertyNotFound(Identifier)

A property of a value was not found.

§

ArgumentCountMismatch

Argument count mismatch.

Fields

§args: ArgumentValueList

Argument list including the error

§expected: usize

Expected number of arguments

§found: usize

Found number of arguments

§

AssertWrongSignature(ArgumentValueList)

Called assertion

§

InvalidArgumentType(Type)

Invalid argument type.

§

UnexpectedArgument(Identifier, Type)

Unexpected argument.

§

AssertionFailed(String)

Assertion failed.

§

ExpectedType

Different type expected.

Fields

§expected: Type

Expected type.

§found: Type

Found type.

§

ErrorLimitReached(u32)

Cannot continue evaluation after error limit has been reached.

§

LocalStackEmpty(Identifier)

No locals available on stack.

§

WrongStackFrame(Identifier, &'static str)

Unexpected stack frame type

§

ValueError(ValueError)

Value Error.

§

UnknownMethod(QualifiedName)

Unknown method.

§

ParseError(ParseError)

Parser Error

§

StatementNotSupported(&'static str)

Statement is not supported in this context.

§

UninitializedProperties(IdentifierList)

Properties are not initialized.

§

UnexpectedNested(&'static str, Identifier)

Unexpected element within expression.

§

NoVariablesAllowedIn(&'static str)

No variables allowed in definition

§

AttributeError(AttributeError)

Error when evaluating attributes.

§

MissingArguments(IdentifierList)

Missing arguments

§

TooManyArguments(IdentifierList)

Missing arguments

§

BuiltinError(String)

Builtin error

§

ParameterByTypeNotFound(Type)

Parameter not found by type in ParameterValueList

§

MultiplicityNotAllowed(IdentifierList)

Trying to use multiplicity where it is not allowed

§

CannotMixGeometry

An error if you try to mix 2d and 3d geometries.

§

IfConditionIsNotBool(Value)

A condition of an if statement is not a boolean

§

NoInitializationFound(Identifier)

Workbench didn’t find a initialization routine matching the given arguments

§

BuildingPlanIncomplete(IdentifierList)

Initializer missed to set a property from plan

§

EmptyModelExpression

This errors happens if the expression is supposed to produce models but did not.

§

WorkbenchInvalidOutput(WorkbenchKind, OutputType, OutputType)

This error happens if the workbench produced a different output type.

§

WorkbenchNoOutput(WorkbenchKind, OutputType)

This error happens if the workbench produced a different output type.

§

InvalidSelfReference(Identifier)

Unexpected source file in expression

§

ResolveError(ResolveError)

Resolve Error

§

NotAnOperation(QualifiedName)

Unexpected source file in expression

§

OperationOnEmptyGeometry

Calling an operation on an empty geometry, e.g.: {}.op().

§

CannotCallOperationWithoutWorkpiece

Cannot call operation without workpiece, e.g. op().

§

MissingReturn(QualifiedName)

Function missing return statement

§

NoModelInWorkbench

There is no model in this workbench

§

AmbiguousProperty(QualifiedName, Identifier)

Found a symbol and a property with that name

§

ValueAlreadyInitialized(Identifier, Value, SrcRef)

Assignment failed because value already has been initialized

§

NotAnLValue(Identifier)

Assignment failed because left side is not an l-value

§

SymbolIsPrivate

Found symbol but it’s not visible to user

Fields

§what: QualifiedName

what was searched

§within: QualifiedName

where it was searched

§

SymbolBehindAliasIsPrivate

Found symbol but it’s not visible to user

Fields

§what: QualifiedName

what was searched

§alias: QualifiedName

the alias in between

§within: QualifiedName

where it was searched

Trait Implementations§

Source§

impl Debug for EvalError

Source§

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

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

impl Display for EvalError

Source§

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

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

impl Error for EvalError

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

impl From<AttributeError> for EvalError

Source§

fn from(source: AttributeError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for EvalError

Source§

fn from(source: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<ResolveError> for EvalError

Source§

fn from(source: ResolveError) -> Self

Converts to this type from the input type.
Source§

impl From<ValueError> for EvalError

Source§

fn from(source: ValueError) -> Self

Converts to this type from the input type.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToCompactString for T
where T: Display,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool