Struct rlua::LuaTable
[−]
[src]
pub struct LuaTable<'lua>(_);
Handle to an internal Lua table.
Methods
impl<'lua> LuaTable<'lua>
[src]
fn set<K: ToLua<'lua>, V: ToLua<'lua>>(&self, key: K, value: V) -> LuaResult<()>
Sets a key-value pair in the table.
If the value is nil
, this will effectively remove the pair.
This might invoke the __newindex
metamethod. Use the raw_set
method if that is not
desired.
fn get<K: ToLua<'lua>, V: FromLua<'lua>>(&self, key: K) -> LuaResult<V>
Gets the value associated to key
from the table.
If no value is associated to key
, returns the nil
value.
This might invoke the __index
metamethod. Use the raw_get
method if that is not desired.
fn contains_key<K: ToLua<'lua>>(&self, key: K) -> LuaResult<bool>
Checks whether the table contains a non-nil value for key
.
fn raw_set<K: ToLua<'lua>, V: ToLua<'lua>>(
&self,
key: K,
value: V
) -> LuaResult<()>
&self,
key: K,
value: V
) -> LuaResult<()>
Sets a key-value pair without invoking metamethods.
fn raw_get<K: ToLua<'lua>, V: FromLua<'lua>>(&self, key: K) -> LuaResult<V>
Gets the value associated to key
without invoking metamethods.
fn len(&self) -> LuaResult<LuaInteger>
Returns the result of the Lua #
operator.
This might invoke the __len
metamethod. Use the raw_len
method if that is not desired.
fn raw_len(&self) -> LuaInteger
Returns the result of the Lua #
operator, without invoking the __len
metamethod.
fn pairs<K: FromLua<'lua>, V: FromLua<'lua>>(self) -> LuaTablePairs<'lua, K, V>
Consume this table and return an iterator over the pairs of the table, works like the Lua 'pairs' function.
fn sequence_values<V: FromLua<'lua>>(self) -> LuaTableSequence<'lua, V>
Consume this table and return an iterator over the values of this table, which should be a sequence. Works like the Lua 'ipairs' function, but doesn't return the indexes, only the values in order.
Trait Implementations
impl<'lua> Clone for LuaTable<'lua>
[src]
fn clone(&self) -> LuaTable<'lua>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more