Struct rlua::Scope [−][src]
pub struct Scope<'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]
impl<'scope> Scope<'scope>
pub fn create_function<'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'lua>,
R: ToLuaMulti<'lua>,
F: 'scope + Fn(&'lua Lua, A) -> Result<R>,
[src]
pub fn create_function<'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'lua>,
R: ToLuaMulti<'lua>,
F: 'scope + Fn(&'lua 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.
pub fn create_function_mut<'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'lua>,
R: ToLuaMulti<'lua>,
F: 'scope + FnMut(&'lua Lua, A) -> Result<R>,
[src]
pub fn create_function_mut<'lua, A, R, F>(
&'lua self,
func: F
) -> Result<Function<'lua>> where
A: FromLuaMulti<'lua>,
R: ToLuaMulti<'lua>,
F: 'scope + FnMut(&'lua 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
and Scope::create_function
for more details.
pub fn create_userdata<'lua, T>(
&'lua self,
data: T
) -> Result<AnyUserData<'lua>> where
T: UserData,
[src]
pub fn create_userdata<'lua, T>(
&'lua self,
data: T
) -> Result<AnyUserData<'lua>> where
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, and does not require that the userdata type be Send. See Lua::scope
for more
details.