pub struct LuaTable { /* private fields */ }Expand description
Represents a table stored in the Lua context.
Loading this type mutably borrows the Lua context.
Implementations§
Source§impl LuaTable
impl LuaTable
Sourcepub fn into_inner(self) -> *mut lua_State
pub fn into_inner(self) -> *mut lua_State
Destroys the LuaTable and returns its inner Lua context. Useful when it takes Lua by value.
Sourcepub fn iter<K, V>(&mut self) -> LuaTableIterator<'_, K, V> ⓘ
pub fn iter<K, V>(&mut self) -> LuaTableIterator<'_, K, V> ⓘ
Iterates over the elements inside the table.
Sourcepub fn query<'a, R, I>(&'a mut self, index: I) -> Option<R>
pub fn query<'a, R, I>(&'a mut self, index: I) -> Option<R>
Loads a value in the table given its index.
Sourcepub fn register<I>(
&mut self,
index: I,
func: extern "C" fn(*mut lua_State) -> c_int,
)where
I: LuaPush,
pub fn register<I>(
&mut self,
index: I,
func: extern "C" fn(*mut lua_State) -> c_int,
)where
I: LuaPush,
Inserts or modifies an elements of the table.
pub fn empty_table<I>(&mut self, index: I) -> LuaTable
pub fn table_len(&mut self) -> usize
pub fn get_or_create_metatable(&mut self) -> LuaTable
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LuaTable
impl RefUnwindSafe for LuaTable
impl !Send for LuaTable
impl !Sync for LuaTable
impl Unpin for LuaTable
impl UnsafeUnpin for LuaTable
impl UnwindSafe for LuaTable
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