@@ -13,7 +13,10 @@ use crate::util::{assert_stack, check_stack, get_metatable_ptr, StackGuard};
13
13
use crate :: value:: { Nil , Value } ;
14
14
15
15
#[ cfg( feature = "async" ) ]
16
- use futures_util:: future:: { self , Either , Future } ;
16
+ use {
17
+ crate :: types:: MaybeSend ,
18
+ futures_util:: future:: { self , Either , Future } ,
19
+ } ;
17
20
18
21
#[ cfg( feature = "serde" ) ]
19
22
use {
@@ -889,9 +892,9 @@ impl ObjectLike for Table {
889
892
890
893
#[ cfg( feature = "async" ) ]
891
894
#[ inline]
892
- fn call_async < R > ( & self , args : impl IntoLuaMulti ) -> impl Future < Output = Result < R > >
895
+ fn call_async < R > ( & self , args : impl IntoLuaMulti ) -> impl Future < Output = Result < R > > + MaybeSend
893
896
where
894
- R : FromLuaMulti ,
897
+ R : FromLuaMulti + MaybeSend ,
895
898
{
896
899
Function ( self . 0 . copy ( ) ) . call_async ( args)
897
900
}
@@ -905,9 +908,13 @@ impl ObjectLike for Table {
905
908
}
906
909
907
910
#[ cfg( feature = "async" ) ]
908
- fn call_async_method < R > ( & self , name : & str , args : impl IntoLuaMulti ) -> impl Future < Output = Result < R > >
911
+ fn call_async_method < R > (
912
+ & self ,
913
+ name : & str ,
914
+ args : impl IntoLuaMulti ,
915
+ ) -> impl Future < Output = Result < R > > + MaybeSend
909
916
where
910
- R : FromLuaMulti ,
917
+ R : FromLuaMulti + MaybeSend ,
911
918
{
912
919
self . call_async_function ( name, ( self , args) )
913
920
}
@@ -925,9 +932,13 @@ impl ObjectLike for Table {
925
932
926
933
#[ cfg( feature = "async" ) ]
927
934
#[ inline]
928
- fn call_async_function < R > ( & self , name : & str , args : impl IntoLuaMulti ) -> impl Future < Output = Result < R > >
935
+ fn call_async_function < R > (
936
+ & self ,
937
+ name : & str ,
938
+ args : impl IntoLuaMulti ,
939
+ ) -> impl Future < Output = Result < R > > + MaybeSend
929
940
where
930
- R : FromLuaMulti ,
941
+ R : FromLuaMulti + MaybeSend ,
931
942
{
932
943
match self . get ( name) {
933
944
Ok ( Value :: Function ( func) ) => Either :: Left ( func. call_async ( args) ) ,
0 commit comments