pub enum LuaError {
Runtime(LuaValue),
Syntax(LuaValue),
Memory,
Error,
Yield,
File,
Gc,
}Expand description
The Lua error type. Carries a LuaValue payload because Lua errors can
be any value (typically a string).
Variants§
Implementations§
Source§impl LuaError
impl LuaError
pub fn runtime(args: Arguments<'_>) -> Self
pub fn syntax(args: Arguments<'_>) -> Self
pub fn syntax_at(args: Arguments<'_>, source: &[u8], line: i32) -> Self
pub fn syntax_raw(msg: &[u8]) -> Self
pub fn type_error(v: &LuaValue, op: &str) -> Self
pub fn call_error(v: &LuaValue) -> Self
pub fn concat_error(p1: &LuaValue, p2: &LuaValue) -> Self
pub fn arith_error(p1: &LuaValue, p2: &LuaValue, _msg: &str) -> Self
pub fn int_overflow(_p1: &LuaValue, _p2: &LuaValue) -> Self
pub fn order_error(p1: &LuaValue, p2: &LuaValue) -> Self
pub fn for_error(v: &LuaValue, what: &str) -> Self
pub fn arg_error(narg: i32, msg: &str) -> Self
pub fn type_arg_error(narg: i32, expected: &str, got: &LuaValue) -> Self
pub fn from_value(v: LuaValue) -> Self
pub fn with_status(status: LuaStatus) -> Self
pub fn to_status(&self) -> LuaStatus
pub fn into_value(self) -> LuaValue
Trait Implementations§
Source§impl Error for LuaError
impl Error for LuaError
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 LuaError
impl !RefUnwindSafe for LuaError
impl !Send for LuaError
impl !Sync for LuaError
impl Unpin for LuaError
impl UnsafeUnpin for LuaError
impl !UnwindSafe for LuaError
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