Struct rlua::LuaTable
[−]
[src]
pub struct LuaTable<'lua>(_);
Handle to an an internal lua table
Methods
impl<'lua> LuaTable<'lua>
[src]
fn set<K: ToLua<'lua>, V: ToLua<'lua>>(&self, key: K, value: V) -> LuaResult<()>
fn get<K: ToLua<'lua>, V: FromLua<'lua>>(&self, key: K) -> LuaResult<V>
fn has<K: ToLua<'lua>>(&self, key: K) -> LuaResult<bool>
Shorthand for checking whether get(key) is nil
fn raw_set<K: ToLua<'lua>, V: ToLua<'lua>>(
&self,
key: K,
value: V
) -> LuaResult<()>
&self,
key: K,
value: V
) -> LuaResult<()>
Set a field in the table, without invoking metamethods
fn raw_get<K: ToLua<'lua>, V: FromLua<'lua>>(&self, key: K) -> LuaResult<V>
Get a field in the table, without invoking metamethods
fn length(&self) -> LuaResult<LuaInteger>
Equivalent to the result of the lua '#' operator.
fn raw_length(&self) -> LuaResult<LuaInteger>
Equivalent to the result of the lua '#' operator, without invoking the __len metamethod.
fn for_each_pair<K, V, F>(&self, f: F) -> LuaResult<()> where
K: FromLua<'lua>,
V: FromLua<'lua>,
F: FnMut(K, V),
K: FromLua<'lua>,
V: FromLua<'lua>,
F: FnMut(K, V),
Loop over each key, value pair in the table
fn for_each_array_value<V: FromLua<'lua>, F: FnMut(V)>(
&self,
f: F
) -> LuaResult<()>
&self,
f: F
) -> LuaResult<()>
Loop over the table, strictly interpreting the table as an array, and fail if it is not a proper lua array.
fn pairs<K: FromLua<'lua>, V: FromLua<'lua>>(&self) -> LuaResult<Vec<(K, V)>>
Collect all the pairs in the table into a Vec
fn array_values<V: FromLua<'lua>>(&self) -> LuaResult<Vec<V>>
Collect all the values in an array-like table into a Vec
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