[][src]Trait rlua_async::FunctionExt

pub trait FunctionExt<'lua> {
    fn call_async<'fut, Arg, Ret>(
        &self,
        ctx: Context<'lua>,
        args: Arg
    ) -> Pin<Box<dyn Future<Output = Result<Ret>> + 'fut>>
    where
        'lua: 'fut,
        Arg: 'fut + ToLuaMulti<'lua>,
        Ret: 'fut + FromLuaMulti<'lua>
; }

Extension trait for rlua::Function

Required methods

fn call_async<'fut, Arg, Ret>(
    &self,
    ctx: Context<'lua>,
    args: Arg
) -> Pin<Box<dyn Future<Output = Result<Ret>> + 'fut>> where
    'lua: 'fut,
    Arg: 'fut + ToLuaMulti<'lua>,
    Ret: 'fut + FromLuaMulti<'lua>, 

Calls the function in an async-compliant way.

By using this on the Rust side, you can recover as a Future the potentiall Poll::Pending that might have been sent by eg. a downstream ContextExt::create_async_function

Loading content...

Implementations on Foreign Types

impl<'lua> FunctionExt<'lua> for Function<'lua>[src]

Loading content...

Implementors

Loading content...