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<'_>) -> LuaError
pub fn syntax(args: Arguments<'_>) -> LuaError
pub fn syntax_at(args: Arguments<'_>, source: &[u8], line: i32) -> LuaError
pub fn syntax_raw(msg: &[u8]) -> LuaError
pub fn type_error(v: &LuaValue, op: &str) -> LuaError
pub fn call_error(v: &LuaValue) -> LuaError
pub fn concat_error(p1: &LuaValue, p2: &LuaValue) -> LuaError
pub fn arith_error(p1: &LuaValue, p2: &LuaValue, _msg: &str) -> LuaError
pub fn int_overflow(_p1: &LuaValue, _p2: &LuaValue) -> LuaError
pub fn order_error(p1: &LuaValue, p2: &LuaValue) -> LuaError
pub fn for_error(v: &LuaValue, what: &str) -> LuaError
pub fn arg_error(narg: i32, msg: &str) -> LuaError
pub fn type_arg_error(narg: i32, expected: &str, got: &LuaValue) -> LuaError
pub fn from_value(v: LuaValue) -> LuaError
pub fn with_status(status: LuaStatus) -> LuaError
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