[−][src]Trait rlua_async::ScopeExt
Extension trait for rlua::Scope
Required methods
fn create_async_function<Arg, Ret, RetFut, F>(
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> Fn(Context<'all>, Arg) -> RetFut,
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> Fn(Context<'all>, Arg) -> RetFut,
Wraps a Rust function or closure, creating a callable Lua function handle to it. See also
rlua::Scope::create_function and ContextExt::create_async_function.
The where clause stipulates a few additional constraints compared to
rlua::Scope::create_function. This is required for compiling the implementation, and
should not be an issue. If it is, please report a bug to rlua-async with instructions on
how to reproduce and your use case.
fn create_async_function_mut<Arg, Ret, RetFut, F>(
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> FnMut(Context<'all>, Arg) -> RetFut,
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> FnMut(Context<'all>, Arg) -> RetFut,
Wraps a mutable Rust function or closure, creating a callable Lua function handle to it.
See [rlua_async::ScopeExt::create_async_function] for more details.
Implementations on Foreign Types
impl<'lua, 'scope> ScopeExt<'lua, 'scope> for Scope<'lua, 'scope>[src]
fn create_async_function<Arg, Ret, RetFut, F>(
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> Fn(Context<'all>, Arg) -> RetFut, [src]
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> Fn(Context<'all>, Arg) -> RetFut,
fn create_async_function_mut<Arg, Ret, RetFut, F>(
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> FnMut(Context<'all>, Arg) -> RetFut, [src]
&self,
ctx: Context<'lua>,
func: F
) -> Result<Function<'lua>> where
Arg: 'scope + for<'all> FromLuaMulti<'all>,
Ret: 'scope + for<'all> ToLuaMulti<'all>,
RetFut: 'scope + Future<Output = Result<Ret>>,
F: 'scope + for<'all> FnMut(Context<'all>, Arg) -> RetFut,