pub enum TableError {
NilIndex,
NanIndex,
InvalidNext,
Overflow,
}Expand description
Errors that table mutation can raise back to the interpreter.
Variants§
NilIndex
t[nil] = … — nil is forbidden as a key.
NanIndex
t[0/0] = … — NaN floats are forbidden as keys.
InvalidNext
next called with a key not present in the table.
Overflow
PUC luaH_resizearray — the array part would have to grow past
MAXASIZE, or the hash part past MAXHBITS. Raised back as
“table overflow” so a runaway a[i] = i loop walls within budget
(5.5/5.4 heavy.lua’s toomanyidx pcalls exactly this scenario).
Trait Implementations§
Source§impl Clone for TableError
impl Clone for TableError
Source§fn clone(&self) -> TableError
fn clone(&self) -> TableError
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 TableError
Source§impl Debug for TableError
impl Debug for TableError
impl Eq for TableError
Source§impl From<TableError> for LuaError
impl From<TableError> for LuaError
Source§fn from(_: TableError) -> LuaError
fn from(_: TableError) -> LuaError
Lift a TableError into a LuaError carrying Value::Nil.
Heap-free so it composes with ? in functions that don’t have
a &mut Vm. The classification is later refined when the error
crosses a Vm boundary (caller can set
Vm::set_error_kind if needed).
Source§impl PartialEq for TableError
impl PartialEq for TableError
Source§fn eq(&self, other: &TableError) -> bool
fn eq(&self, other: &TableError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TableError
Auto Trait Implementations§
impl Freeze for TableError
impl RefUnwindSafe for TableError
impl Send for TableError
impl Sync for TableError
impl Unpin for TableError
impl UnsafeUnpin for TableError
impl UnwindSafe for TableError
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