pub enum VMError {
Show 16 variants
StackUnderflow,
StackOverflow,
TypeError {
expected: &'static str,
got: &'static str,
},
DivisionByZero,
UndefinedVariable(String),
UndefinedProperty(String),
InvalidCall,
IndexOutOfBounds {
index: i32,
length: usize,
},
InvalidOperand,
ArityMismatch {
function: String,
expected: usize,
got: usize,
},
InvalidArgument {
function: String,
message: String,
},
NotImplemented(String),
RuntimeError(String),
Suspended {
future_id: u64,
resume_ip: usize,
},
Interrupted,
ResumeRequested,
}Expand description
VM runtime errors
Variants§
StackUnderflow
Stack underflow
StackOverflow
Stack overflow
TypeError
Type mismatch
DivisionByZero
Division by zero
UndefinedVariable(String)
Variable not found
UndefinedProperty(String)
Property not found
InvalidCall
Invalid function call
IndexOutOfBounds
Invalid array index
InvalidOperand
Invalid operand
ArityMismatch
Wrong number of arguments passed to a function
InvalidArgument
Invalid argument value (correct type, wrong value)
NotImplemented(String)
Feature not yet implemented
RuntimeError(String)
Runtime error with message
Suspended
VM suspended on await — not a real error, used to propagate suspension up the Rust call stack
Interrupted
Execution interrupted by Ctrl+C signal
ResumeRequested
Internal: state.resume() requested VM state restoration. Not a real error — intercepted by the dispatch loop.
Implementations§
Trait Implementations§
Source§impl Error for VMError
impl Error for VMError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ShapeError> for VMError
impl From<ShapeError> for VMError
Source§fn from(err: ShapeError) -> Self
fn from(err: ShapeError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for VMError
Auto Trait Implementations§
impl Freeze for VMError
impl RefUnwindSafe for VMError
impl Send for VMError
impl Sync for VMError
impl Unpin for VMError
impl UnsafeUnpin for VMError
impl UnwindSafe for VMError
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
Mutably borrows from an owned value. Read more