[−][src]Enum rlua::Error
Error type returned by rlua methods.
Variants
SyntaxErrorSyntax error while parsing Lua source code.
Fields of SyntaxError
RuntimeError(StdString)Lua runtime error, aka LUA_ERRRUN.
The Lua VM returns this error when a builtin operation is performed on incompatible types.
Among other things, this includes invoking operators on wrong types (such as calling or
indexing a nil value).
MemoryError(StdString)Lua memory error, aka LUA_ERRMEM
The Lua VM returns this error when the allocator does not return the requested memory, aka it is an out-of-memory error.
GarbageCollectorError(StdString)Lua garbage collector error, aka LUA_ERRGCMM.
The Lua VM returns this error when there is an error running a __gc metamethod.
RecursiveMutCallbackA mutable callback has triggered Lua code that has called the same mutable callback again.
This is an error because a mutable callback can only be borrowed mutably once.
CallbackDestructedEither a callback or a userdata method has been called, but the callback or userdata has been destructed.
This can happen either due to to being destructed in a previous __gc, or due to being
destructed from exiting a Lua::scope call.
StackErrorNot enough stack space to place arguments to Lua functions or return values from callbacks.
Due to the way rlua works, it should not be directly possible to run out of stack space
during normal use. The only way that this error can be triggered is if a Function is
called with a huge number of arguments, or a rust callback returns a huge number of return
values.
BindErrorToo many arguments to Function::bind
ToLuaConversionErrorA Rust value could not be converted to a Lua value.
Fields of ToLuaConversionError
FromLuaConversionErrorA Lua value could not be converted to the expected Rust type.
Fields of FromLuaConversionError
CoroutineInactiveThread::resume was called on an inactive coroutine.
A coroutine is inactive if its main function has returned or if an error has occured inside the coroutine.
Thread::status can be used to check if the coroutine can be resumed without causing this
error.
UserDataTypeMismatchAn AnyUserData is not the expected type in a borrow.
This error can only happen when manually using AnyUserData, or when implementing
metamethods for binary operators. Refer to the documentation of UserDataMethods for
details.
UserDataBorrowErrorAn AnyUserData immutable borrow failed because it is already borrowed mutably.
This error can occur when a method on a UserData type calls back into Lua, which then
tries to call a method on the same UserData type. Consider restructuring your API to
prevent these errors.
UserDataBorrowMutErrorAn AnyUserData mutable borrow failed because it is already borrowed.
This error can occur when a method on a UserData type calls back into Lua, which then
tries to call a method on the same UserData type. Consider restructuring your API to
prevent these errors.
MismatchedRegistryKeyA RegistryKey produced from a different Lua state was used.
CallbackErrorA Rust callback returned Err, raising the contained Error as a Lua error.
Fields of CallbackError
ExternalError(Arc<dyn StdError + Send + Sync>)A custom error.
This can be used for returning user-defined errors from callbacks.
Returning Err(ExternalError(...)) from a Rust callback will raise the error as a Lua
error. The Rust code that originally invoked the Lua code then receives a CallbackError,
from which the original error (and a stack traceback) can be recovered.
Methods
impl Error[src]
Trait Implementations
impl<'lua> ToLua<'lua> for Error[src]
impl<'lua> FromLua<'lua> for Error[src]
impl Clone for Error[src]
fn clone(&self) -> Error[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Error[src]
impl Display for Error[src]
impl Error for Error[src]
fn source(&self) -> Option<&(dyn StdError + 'static)>[src]
fn description(&self) -> &str1.0.0[src]
This method is soft-deprecated. Read more
fn cause(&self) -> Option<&dyn Error>1.0.0[src]
replaced by Error::source, which can support downcasting
The lower-level cause of this error, if any. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,