Trait ChunkExt

Source
pub trait ChunkExt<'lua, 'a> {
    // Required methods
    fn exec_async<'fut>(
        self,
        ctx: Context<'lua>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 'fut>>
       where 'lua: 'fut;
    fn call_async<'fut, Arg, Ret>(
        self,
        ctx: Context<'lua>,
        args: Arg,
    ) -> Pin<Box<dyn Future<Output = Result<Ret>> + 'fut>>
       where Arg: 'fut + ToLuaMulti<'lua>,
             Ret: 'fut + FromLuaMulti<'lua>,
             'lua: 'fut;
}
Expand description

Extension trait for rlua::Chunk

Note that there is currently no eval_async function to match rlua::Chunk::eval. This is due to a missing function in the API of rlua::Chunk. See also this pull request.

Required Methods§

Source

fn exec_async<'fut>( self, ctx: Context<'lua>, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'fut>>
where 'lua: 'fut,

Asynchronously execute this chunk of code. See also rlua::Chunk::exec.

Source

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

Load the chunk function and call it with the given arguments. See also rlua::Chunk::call.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'lua, 'a> ChunkExt<'lua, 'a> for Chunk<'lua, 'a>

Source§

fn exec_async<'fut>( self, ctx: Context<'lua>, ) -> Pin<Box<dyn Future<Output = Result<()>> + 'fut>>
where 'lua: 'fut,

Source§

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

Implementors§