Struct rlua::Lua
[−]
[src]
pub struct Lua { /* fields omitted */ }
Top level Lua struct which holds the lua state itself.
Methods
impl Lua
[src]
fn new() -> Lua
fn load(&self, source: &str, name: Option<&str>) -> LuaResult<()>
fn eval<'lua, R: FromLuaMulti<'lua>>(&'lua self, source: &str) -> LuaResult<R>
Evaluate the given expression or statement inside this Lua state, and if it is an expression or a statement with return, this returns the value.
fn create_string(&self, s: &str) -> LuaResult<LuaString>
fn create_empty_table(&self) -> LuaResult<LuaTable>
fn create_table<'lua, K, V, I>(&'lua self, cont: I) -> LuaResult<LuaTable> where
K: ToLua<'lua>,
V: ToLua<'lua>,
I: IntoIterator<Item = (K, V)>,
K: ToLua<'lua>,
V: ToLua<'lua>,
I: IntoIterator<Item = (K, V)>,
fn create_array_table<'lua, T, I>(&'lua self, cont: I) -> LuaResult<LuaTable> where
T: ToLua<'lua>,
I: IntoIterator<Item = T>,
T: ToLua<'lua>,
I: IntoIterator<Item = T>,
fn create_function<F>(&self, func: F) -> LuaResult<LuaFunction> where
F: 'static + for<'a> FnMut(&'a Lua, LuaMultiValue<'a>) -> LuaResult<LuaMultiValue<'a>>,
F: 'static + for<'a> FnMut(&'a Lua, LuaMultiValue<'a>) -> LuaResult<LuaMultiValue<'a>>,
fn create_thread<'lua>(
&'lua self,
func: LuaFunction<'lua>
) -> LuaResult<LuaThread<'lua>>
&'lua self,
func: LuaFunction<'lua>
) -> LuaResult<LuaThread<'lua>>
fn create_userdata<T>(&self, data: T) -> LuaResult<LuaUserData> where
T: LuaUserDataType,
T: LuaUserDataType,
fn set<'lua, K, V>(&'lua self, key: K, value: V) -> LuaResult<()> where
K: ToLua<'lua>,
V: ToLua<'lua>,
K: ToLua<'lua>,
V: ToLua<'lua>,
fn get<'lua, K, V>(&'lua self, key: K) -> LuaResult<V> where
K: ToLua<'lua>,
V: FromLua<'lua>,
K: ToLua<'lua>,
V: FromLua<'lua>,
fn coerce_string<'lua>(
&'lua self,
v: LuaValue<'lua>
) -> LuaResult<LuaString<'lua>>
&'lua self,
v: LuaValue<'lua>
) -> LuaResult<LuaString<'lua>>
fn coerce_integer(&self, v: LuaValue) -> LuaResult<LuaInteger>
fn coerce_number(&self, v: LuaValue) -> LuaResult<LuaNumber>
fn from<'lua, T: ToLua<'lua>>(&'lua self, t: T) -> LuaResult<LuaValue<'lua>>
fn to<'lua, T: FromLua<'lua>>(&'lua self, value: LuaValue<'lua>) -> LuaResult<T>
fn pack<'lua, T: ToLuaMulti<'lua>>(
&'lua self,
t: T
) -> LuaResult<LuaMultiValue<'lua>>
&'lua self,
t: T
) -> LuaResult<LuaMultiValue<'lua>>
fn unpack<'lua, T: FromLuaMulti<'lua>>(
&'lua self,
value: LuaMultiValue<'lua>
) -> LuaResult<T>
&'lua self,
value: LuaMultiValue<'lua>
) -> LuaResult<T>