Enum yksom::vm::error::VMErrorKind[][src]

pub enum VMErrorKind {
Show variants BuiltinTypeError { expected: ObjType, got: ObjType, }, CantRepresentAsDouble, CantRepresentAsIsize, CantRepresentAsUsize, DivisionByZero, DomainError, Exit(i32), IndexError { tried: usize, max: usize, }, InstanceTypeError { expected_cls: Val, got_cls: Val, }, InvalidDouble(SmartString), InvalidInteger(SmartString), InvalidSymbol, NegativeShift, NotANumber { got: ObjType, }, PrimitiveError, RemainderError, ShiftTooBig, UnknownGlobal(SmartString), UnknownMethod, WrongNumberOfArgs { wanted: usize, got: usize, },
}

Variants

BuiltinTypeError

We expected a Rust type expected but at run-time got a Rust type got.

Fields of BuiltinTypeError

expected: ObjTypegot: ObjType
CantRepresentAsDouble

A value which can’t be represented in an f64.

CantRepresentAsIsize

A value which can’t be represented in an isize.

CantRepresentAsUsize

A value which can’t be represented in an usize.

DivisionByZero
DomainError

A value which is mathematically undefined.

Exit(i32)

The VM is trying to exit.

IndexError

Tried to access an out-of-bounds element.

Fields of IndexError

tried: usizemax: usize
InstanceTypeError

We expected a SOM value that is an instance of expected_cls but at run-time got a SOM value that is an instance of got_cls.

Fields of InstanceTypeError

expected_cls: Valgot_cls: Val
InvalidDouble(SmartString)

Tried to convert an invalid string to a Double.

InvalidInteger(SmartString)

Tried to convert an invalid string to an Integer.

InvalidSymbol

Tried to access a global before it being initialised.

NegativeShift

Tried to do a shl or shr with a value below zero.

NotANumber

A specialised version of TypeError, because SOM has more than one number type (and casts between them as necessary) so the expected field of TypeError doesn’t quite work.

Fields of NotANumber

got: ObjType
PrimitiveError

Something went wrong when trying to execute a primitive.

RemainderError

Tried to calculate a remainder that was a divide by zero or resulted in overflow.

ShiftTooBig

Tried to do a shl that would overflow memory and/or not fit in the required integer size.

UnknownGlobal(SmartString)

An unknown global.

UnknownMethod

An unknown method.

WrongNumberOfArgs

Tried calling a method with the wrong number of arguments.

Fields of WrongNumberOfArgs

wanted: usizegot: usize

Trait Implementations

impl Debug for VMErrorKind[src]

impl PartialEq<VMErrorKind> for VMErrorKind[src]

impl StructuralPartialEq for VMErrorKind[src]

Auto Trait Implementations

impl !NoTrace for VMErrorKind

impl RefUnwindSafe for VMErrorKind

impl Send for VMErrorKind

impl Sync for VMErrorKind

impl Unpin for VMErrorKind

impl UnwindSafe for VMErrorKind

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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