Implement async support in metatype
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
__internal::{display, type_id},
|
||||
Cdef, CdefBuilder, IntoFfi, Metatype, MetatypeBuilder, Type, TypeBuilder, TypeType,
|
||||
UnsafeExternCFn,
|
||||
Cdef, CdefBuilder, FfiReturnConvention, IntoFfi, Metatype, MetatypeBuilder, Type, TypeBuilder,
|
||||
TypeType, UnsafeExternCFn,
|
||||
};
|
||||
use luaify::luaify;
|
||||
use std::{
|
||||
@@ -168,6 +168,11 @@ unsafe impl<F: Future<Output: IntoFfi> + 'static> Metatype for lua_future<F> {
|
||||
unsafe impl<F: Future<Output: IntoFfi> + 'static> IntoFfi for lua_future<F> {
|
||||
type Into = lua_future<F>;
|
||||
|
||||
fn convention() -> FfiReturnConvention {
|
||||
// futures are always returned by-value due to rust type inference limitations
|
||||
FfiReturnConvention::ByValue
|
||||
}
|
||||
|
||||
fn convert(self) -> Self::Into {
|
||||
self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user