Enum StackError

Source
pub enum StackError {
Show 22 variants IterationError, StackEmpty, PopOutOfBounds { frame: usize, }, SlotMissing { slot: Slot, }, SlotInaccessibleExclusive { slot: Slot, }, SlotInaccessibleShared { slot: Slot, }, UnexpectedSlotType { expected: &'static str, actual: &'static str, }, ExpectedNone { actual: ValueTypeInfo, }, ExpectedBoolean { actual: ValueTypeInfo, }, ExpectedChar { actual: ValueTypeInfo, }, ExpectedInteger { actual: ValueTypeInfo, }, ExpectedFloat { actual: ValueTypeInfo, }, ExpectedString { actual: ValueTypeInfo, }, ExpectedArray { actual: ValueTypeInfo, }, ExpectedArrayLength { actual: usize, expected: usize, }, ExpectedObject { actual: ValueTypeInfo, }, ExpectedExternal { actual: ValueTypeInfo, }, ExpectedManaged { actual: ValueTypeInfo, }, IncompatibleSlot, ValueToIntegerCoercionError { from: Integer, to: &'static str, }, IntegerToValueCoercionError { from: Integer, to: &'static str, }, CorruptedStackFrame { stack_top: usize, frame_at: usize, },
}
Expand description

An error raised when interacting with types on the stack.

Variants§

§

IterationError

Internal error that happens when we run out of items in a list.

§

StackEmpty

stack is empty

§

PopOutOfBounds

Attempt to pop outside of current frame offset.

Fields

§frame: usize

CallFrame offset that we tried to pop.

§

SlotMissing

The given slot is missing.

Fields

§slot: Slot

The slot that was missing.

§

SlotInaccessibleExclusive

The given slot is inaccessible.

Fields

§slot: Slot

The slot that could not be accessed.

§

SlotInaccessibleShared

The given slot is inaccessible.

Fields

§slot: Slot

The slot that could not be accessed.

§

UnexpectedSlotType

Error raised when we expect a specific external type but got another.

Fields

§expected: &'static str

The type that was expected.

§actual: &'static str

The type that was found.

§

ExpectedNone

Error raised when we expected a unit.

Fields

§actual: ValueTypeInfo

The actual type found.

§

ExpectedBoolean

Error raised when we expected a boolean value.

Fields

§actual: ValueTypeInfo

The actual type found.

§

ExpectedChar

Error raised when we expected a char value.

Fields

§actual: ValueTypeInfo

The actual type found.

§

ExpectedInteger

Error raised when an integer value was expected.

Fields

§actual: ValueTypeInfo

The actual type found.

§

ExpectedFloat

Error raised when we expected a float value.

Fields

§actual: ValueTypeInfo

The actual type found.

§

ExpectedString

Error raised when we expected a string.

Fields

§actual: ValueTypeInfo

The actual type observed instead.

§

ExpectedArray

Error raised when we expected a array.

Fields

§actual: ValueTypeInfo

The actual type observed instead.

§

ExpectedArrayLength

Error raised when we expected an array of the given length.

Fields

§actual: usize

The actual length observed.

§expected: usize

The expected array length.

§

ExpectedObject

Error raised when we expected a object.

Fields

§actual: ValueTypeInfo

The actual type observed instead.

§

ExpectedExternal

Error raised when we expected an external value.

Fields

§actual: ValueTypeInfo

The actual type observed instead.

§

ExpectedManaged

Error raised when we expected a managed value.

Fields

§actual: ValueTypeInfo

The actual type observed instead.

§

IncompatibleSlot

Error raised when we expected a managed value with a specific slot.

§

ValueToIntegerCoercionError

Failure to convert a number into an integer.

Fields

§from: Integer

Number we tried to convert from.

§to: &'static str

Number type we tried to convert to.

§

IntegerToValueCoercionError

Failure to convert an integer into a value.

Fields

§from: Integer

Number we tried to convert from.

§to: &'static str

Number type we tried to convert to.

§

CorruptedStackFrame

We encountered a corrupted stack frame.

Fields

§stack_top: usize

The size of the stack.

§frame_at: usize

The location of the stack frame.

Trait Implementations§

Source§

impl Debug for StackError

Source§

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

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

impl Display for StackError

Source§

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

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

impl Error for StackError

1.30.0 · 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<StackError> for VmError

Source§

fn from(source: StackError) -> 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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V