@@ -13,7 +13,10 @@ use crate::util::{assert_stack, check_stack, get_metatable_ptr, StackGuard};
1313use crate :: value:: { Nil , Value } ;
1414
1515#[ 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+ } ;
1720
1821#[ cfg( feature = "serde" ) ]
1922use {
@@ -889,9 +892,9 @@ impl ObjectLike for Table {
889892
890893 #[ cfg( feature = "async" ) ]
891894 #[ 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
893896 where
894- R : FromLuaMulti ,
897+ R : FromLuaMulti + MaybeSend ,
895898 {
896899 Function ( self . 0 . copy ( ) ) . call_async ( args)
897900 }
@@ -905,9 +908,13 @@ impl ObjectLike for Table {
905908 }
906909
907910 #[ 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
909916 where
910- R : FromLuaMulti ,
917+ R : FromLuaMulti + MaybeSend ,
911918 {
912919 self . call_async_function ( name, ( self , args) )
913920 }
@@ -925,9 +932,13 @@ impl ObjectLike for Table {
925932
926933 #[ cfg( feature = "async" ) ]
927934 #[ 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
929940 where
930- R : FromLuaMulti ,
941+ R : FromLuaMulti + MaybeSend ,
931942 {
932943 match self . get ( name) {
933944 Ok ( Value :: Function ( func) ) => Either :: Left ( func. call_async ( args) ) ,
0 commit comments