pub fn spawn<F, T>(f: F) -> impl Future<Output = LuaResult<T>>
where
    F: Future<Output = Result<T, LuaError>> + Send + 'static,
    T: Send + 'static,
{
    futures::future::ready(get_runtime()).and_then(|rt| {
        rt.spawn(f).map(|result| match result {
            Ok(x) => x.to_lua_err(),
            Err(x) => Err(x).to_lua_err(),
        })
    })
}
/// Spawns a task on the global runtime for a future that returns a `LuaResult<T>`
Spawns a task on the global runtime for a future that returns a `LuaResult`
Spawns a task on the global runtime for a future that returns a ` LuaResult `
pub fn spawn<F, T>(f: F) -> impl Future<Output = LuaResult<T>>
where
    F: Future<Output = Result<T, LuaError>> + Send + 'static,
    T: Send + 'static,
{
    futures::future::ready(get_runtime()).and_then(|rt| {
        rt.spawn(f).map(|result| match result {
            Ok(x) => x.to_lua_err(),
            Err(x) => Err(x).to_lua_err(),
        })
    })
}
pub fn spawn < F , T > ( f : F ) -> impl Future < Output = LuaResult < T > > where F : Future < Output = Result < T , LuaError > > + Send + ' static , T : Send + ' static , { futures :: future :: ready ( get_runtime ( ) ) . and_then ( | rt | { rt . spawn ( f ) . map ( | result | match result { Ok ( x ) => x . to_lua_err ( ) , Err ( x ) => Err ( x ) . to_lua_err ( ) , } ) } ) }
Spawns a task on the global runtime for a future that returns a `LuaResult<T>`
Spawns a task on the global runtime for a future that returns a ` LuaResult<T > `
f
F