pub enum LuaErrorKind {
Runtime,
Syntax,
InstrBudget,
MemoryCap,
Native,
OutOfMemory,
Type,
}Expand description
Classification of the most recent error raised on a Vm.
Embedders switch on this to decide whether to retry (InstrBudget,
MemoryCap), report (Runtime, Syntax), or treat as fatal
(Native, OutOfMemory). Default is LuaErrorKind::Runtime.
Variants§
Runtime
Generic Lua runtime error (error(...), type errors, missing
global, etc.). The default classification.
Syntax
Source did not parse (lexer or parser rejected the input).
InstrBudget
vm.set_instr_budget(Some(N)) budget exhausted mid-call.
MemoryCap
vm.set_memory_cap(Some(N)) cap exceeded during allocation.
Native
A NativeFn callback returned Err(LuaError) (host-side error).
OutOfMemory
Allocation failed (typically only on cap exhaustion in luna).
Type
error raised at a type boundary (e.g. arithmetic on a table).
Trait Implementations§
Source§impl Clone for LuaErrorKind
impl Clone for LuaErrorKind
Source§fn clone(&self) -> LuaErrorKind
fn clone(&self) -> LuaErrorKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LuaErrorKind
Source§impl Debug for LuaErrorKind
impl Debug for LuaErrorKind
Source§impl Default for LuaErrorKind
impl Default for LuaErrorKind
Source§fn default() -> LuaErrorKind
fn default() -> LuaErrorKind
Returns the “default value” for a type. Read more
Source§impl Display for LuaErrorKind
impl Display for LuaErrorKind
impl Eq for LuaErrorKind
Source§impl Hash for LuaErrorKind
impl Hash for LuaErrorKind
Source§impl PartialEq for LuaErrorKind
impl PartialEq for LuaErrorKind
Source§fn eq(&self, other: &LuaErrorKind) -> bool
fn eq(&self, other: &LuaErrorKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LuaErrorKind
Auto Trait Implementations§
impl Freeze for LuaErrorKind
impl RefUnwindSafe for LuaErrorKind
impl Send for LuaErrorKind
impl Sync for LuaErrorKind
impl Unpin for LuaErrorKind
impl UnsafeUnpin for LuaErrorKind
impl UnwindSafe for LuaErrorKind
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