Struct rlua::prelude::LuaScope
[−]
[src]
pub struct LuaScope<'scope> { /* fields omitted */ }
Constructed by the Lua::scope
method, allows temporarily passing to Lua userdata that is
!Send, and callbacks that are !Send and not 'static.
See Lua::scope
for more details.
Methods
impl<'scope> Scope<'scope>
[src]
fn create_function<'callback, 'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'callback>,
R: ToLuaMulti<'callback>,
F: 'scope + Fn(&'callback Lua, A) -> Result<R>,
[src]
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'callback>,
R: ToLuaMulti<'callback>,
F: 'scope + Fn(&'callback Lua, A) -> Result<R>,
Wraps a Rust function or closure, creating a callable Lua function handle to it.
This is a version of Lua::create_function
that creates a callback which expires on scope
drop. See Lua::scope
for more details.
fn create_function_mut<'callback, 'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'callback>,
R: ToLuaMulti<'callback>,
F: 'scope + FnMut(&'callback Lua, A) -> Result<R>,
[src]
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'callback>,
R: ToLuaMulti<'callback>,
F: 'scope + FnMut(&'callback Lua, A) -> Result<R>,
Wraps a Rust mutable closure, creating a callable Lua function handle to it.
This is a version of Lua::create_function_mut
that creates a callback which expires on scope
drop. See Lua::scope
for more details.
fn create_userdata<'lua, T>(&'lua self, data: T) -> Result<AnyUserData<'lua>> where
T: UserData,
[src]
T: UserData,
Create a Lua userdata object from a custom userdata type.
This is a version of Lua::create_userdata
that creates a userdata which expires on scope
drop. See Lua::scope
for more details.