pub enum VmError {
Read(NcsReadError),
Unsupported {
offset: usize,
opcode: NcsOpcode,
auxcode: NcsAuxCode,
message: String,
},
StackUnderflow {
message: String,
},
TypeMismatch {
offset: usize,
message: String,
expected: Option<&'static str>,
actual: &'static str,
},
InvalidInstructionPointer {
offset: usize,
},
InvalidExtra {
offset: usize,
opcode: NcsOpcode,
auxcode: NcsAuxCode,
message: String,
},
InvalidCommand {
offset: usize,
command: u16,
},
Setup {
message: String,
},
InstructionLimitExceeded {
offset: usize,
limit: usize,
},
}Expand description
Errors returned while executing NCS bytecode.
Variants§
Read(NcsReadError)
Decoding the bytecode stream failed before execution began.
Unsupported
One instruction requested a feature this VM does not yet implement.
Fields
§
auxcode: NcsAuxCodeAuxcode that failed.
StackUnderflow
One stack access ran past the available values.
TypeMismatch
One instruction expected a value of a different runtime type.
Fields
InvalidInstructionPointer
One jump or return target did not point at a valid instruction.
InvalidExtra
One opcode payload was malformed.
Fields
§
auxcode: NcsAuxCodeAuxcode whose payload failed.
InvalidCommand
One command id was invoked without a registered handler.
Setup
One host-side setup or invocation request was invalid before execution.
InstructionLimitExceeded
One VM run exceeded the configured instruction budget.
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<NcsReadError> for VmError
impl From<NcsReadError> for VmError
Source§fn from(value: NcsReadError) -> Self
fn from(value: NcsReadError) -> Self
Converts to this type from the input type.
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