pub enum Error {
MemoryAllocation(String),
Syntax(String),
Runtime(String),
Message(String),
Unknown {
code: i32,
message: String,
},
Type {
expected: String,
got: String,
},
BadArgument {
arg_num: i32,
function: String,
cause: String,
},
}Variants§
MemoryAllocation(String)
Lua failed to allocate memory for an operation.
Syntax(String)
A syntax error was encountered while parsing Lua source code. Optionally contains the error message from the Lua parser.
Runtime(String)
A runtime error occurred during Lua execution. Optionally contains the error message returned by Lua.
Message(String)
A generic error represented by a string message.
Unknown
An unrecognized or unknown Lua error code was returned. Contains the raw error code from Lua.
Type
A type mismatch occurred
BadArgument
Bad argument to a function
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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