Struct hlua::lua_tables::LuaTable [] [src]

pub struct LuaTable<L> {
    // some fields omitted
}

Represents a table stored in the Lua context.

Loading this type mutably borrows the Lua context.

Methods

impl<L> LuaTable<L> where L: AsMutLua
[src]

fn into_inner(self) -> L

Destroys the LuaTable and returns its inner Lua context. Useful when it takes Lua by value.

fn iter<K, V>(&mut self) -> LuaTableIterator<L, K, V>

Iterates over the elements inside the table.

fn get<'a, R, I>(&'a mut self, index: I) -> Option<R> where R: LuaRead<PushGuard<&'a mut LuaTable<L>>>, I: for<'b> Push<&'b mut &'a mut LuaTable<L>>

Loads a value in the table given its index.

fn into_get<'a, R, I>(self, index: I) -> Result<R, PushGuard<Self>> where R: LuaRead<PushGuard<LuaTable<L>>>, I: for<'b> Push<&'b mut LuaTable<L>>

Loads a value in the table, with the result capturing the table by value.

fn set<'s, I, V>(&'s mut self, index: I, value: V) where I: for<'a> Push<&'a mut &'s mut LuaTable<L>>, V: for<'a> Push<&'a mut &'s mut LuaTable<L>>

Inserts or modifies an elements of the table.

fn empty_array<'s, I>(&'s mut self, index: I) -> LuaTable<PushGuard<&'s mut LuaTable<L>>> where I: for<'a> Push<&'a mut &'s mut LuaTable<L>> + Clone

Inserts an empty array, then loads it.

fn get_or_create_metatable(self) -> LuaTable<PushGuard<L>>

Obtains or create the metatable of the table.

Trait Implementations

impl<L> AsLua for LuaTable<L> where L: AsLua
[src]

fn as_lua(&self) -> LuaContext

impl<L> AsMutLua for LuaTable<L> where L: AsMutLua
[src]

fn as_mut_lua(&mut self) -> LuaContext

impl<L> LuaRead<L> for LuaTable<L> where L: AsMutLua
[src]

fn lua_read_at_position(lua: L, index: i32) -> Result<LuaTable<L>, L>

Reads the data from Lua at a given position.

fn lua_read(lua: L) -> Result<Self, L>

Reads the data from Lua.