#[non_exhaustive]pub enum Fault {
Show 28 variants
NoBudget,
Timeout,
Waiting,
Exception(Value),
FrameChanged,
Forbidden,
UnknownSymbol,
IncorrectNumberOfArguments,
PatternMismatch,
OperationOnNil,
ValueFreed,
NotAModule,
NotAFunction,
StackOverflow,
StackUnderflow,
UnsupportedOperation,
OutOfMemory,
OutOfBounds,
NotMutable,
DivideByZero,
InvalidInstructionAddress,
ExpectedSymbol,
ExpectedInteger,
ExpectedString,
ExpectedList,
InvalidArity,
InvalidLabel,
InvalidOpcode,
}Expand description
A virtual machine error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoBudget
The budget for the virtual machine has been exhausted.
Timeout
Execution did not complete before a timeout occurred.
Waiting
The virtual machine is waiting for an async task.
Exception(Value)
A thrown exception was not handled.
FrameChanged
The execution frame has changed.
Forbidden
A declaration was found, but it is not accessible by the currently executing code.
UnknownSymbol
A symbol could not be resolved to a declaration or function.
IncorrectNumberOfArguments
A function was invoked with an unsupported number of arguments.
PatternMismatch
A pattern could not be matched.
OperationOnNil
An unsupported operation was performed on Value::NIL.
ValueFreed
A value was freed.
This, in general, should not happen, but it can happen through
intentional usage or if a type does not implement [Trace] correctly.
NotAModule
A value was expected to be a module, but was not.
NotAFunction
A value was invoked but is not invokable.
StackOverflow
An allocation failed because the stack is full.
StackUnderflow
An attempt to return from the execution root.
UnsupportedOperation
A general error indicating an unsupported operation.
OutOfMemory
An allocation could not be performed due to memory constraints.
OutOfBounds
An operation attempted to access something outside of its bounds.
NotMutable
An assignment was attempted to an immutable declaration.
DivideByZero
A value was divided by zero.
InvalidInstructionAddress
Execution jumped to an invalid instruction address.
ExpectedSymbol
An operation expected a symbol.
ExpectedInteger
An operation expected an integer.
ExpectedString
An operation expected a string.
ExpectedList
An operation expected a list.
InvalidArity
An invalid value was provided for the Arity of a function.
InvalidLabel
An invalid label was encountered.
InvalidOpcode
An instruction referenced an invalid index.
This is differen than a Fault::OutOfBounds because this fault
indicates invalid code rather than a logic error.
Implementations§
Trait Implementations§
source§impl From<ValueFreed> for Fault
impl From<ValueFreed> for Fault
source§fn from(_value: ValueFreed) -> Self
fn from(_value: ValueFreed) -> Self
impl StructuralPartialEq for Fault
Auto Trait Implementations§
impl Freeze for Fault
impl RefUnwindSafe for Fault
impl Send for Fault
impl Sync for Fault
impl Unpin for Fault
impl UnwindSafe for Fault
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)