#[non_exhaustive]pub enum MiraError {
InvalidBytecode {
offset: usize,
reason: InvalidBytecodeReason,
},
Compile {
diagnostics: Vec<Diagnostics>,
},
Runtime {
kind: RuntimeErrorKind,
trace: RuntimeTrace,
},
Conversion {
reason: ConversionReason,
path: Vec<ConversionPathSegment>,
},
External(Error),
}Expand description
An error produced while compiling, decoding, executing, or bridging values.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidBytecode
The compiled bytecode chunk failed structural validation.
Fields
§
reason: InvalidBytecodeReasonStructural validation failure.
Compile
Source compilation failed.
Fields
§
diagnostics: Vec<Diagnostics>Compiler diagnostics encoded by mirascript-core.
Runtime
Script execution failed.
Fields
§
kind: RuntimeErrorKindStructured runtime failure.
§
trace: RuntimeTraceExecution location and stack.
Conversion
A MiraScript value could not be converted to a Rust type.
Fields
§
reason: ConversionReasonStructured conversion failure.
§
path: Vec<ConversionPathSegment>Nested field and index path.
External(Error)
A host callback returned an arbitrary error.
Implementations§
Trait Implementations§
Source§impl Error for MiraError
impl Error for MiraError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for MiraError
impl !UnwindSafe for MiraError
impl Freeze for MiraError
impl Send for MiraError
impl Sync for MiraError
impl Unpin for MiraError
impl UnsafeUnpin for MiraError
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