@@ -21,7 +21,9 @@ use crate::userdata::{AnyUserData, UserData, UserDataRef, UserDataRefMut};
21
21
use crate :: value:: { FromLua , IntoLua , Nil , Value } ;
22
22
23
23
#[ cfg( all( feature = "unstable" , any( not( feature = "send" ) , doc) ) ) ]
24
- use crate :: { function:: OwnedFunction , table:: OwnedTable , userdata:: OwnedAnyUserData } ;
24
+ use crate :: {
25
+ function:: OwnedFunction , table:: OwnedTable , thread:: OwnedThread , userdata:: OwnedAnyUserData ,
26
+ } ;
25
27
26
28
impl < ' lua > IntoLua < ' lua > for Value < ' lua > {
27
29
#[ inline]
@@ -232,6 +234,38 @@ impl<'lua> FromLua<'lua> for Thread<'lua> {
232
234
}
233
235
}
234
236
237
+ #[ cfg( all( feature = "unstable" , any( not( feature = "send" ) , doc) ) ) ]
238
+ #[ cfg_attr( docsrs, doc( cfg( all( feature = "unstable" , not( feature = "send" ) ) ) ) ) ]
239
+ impl < ' lua > IntoLua < ' lua > for OwnedThread {
240
+ #[ inline]
241
+ fn into_lua ( self , lua : & ' lua Lua ) -> Result < Value < ' lua > > {
242
+ Ok ( Value :: Thread ( Thread ( lua. adopt_owned_ref ( self . 0 ) , self . 1 ) ) )
243
+ }
244
+ }
245
+
246
+ #[ cfg( all( feature = "unstable" , any( not( feature = "send" ) , doc) ) ) ]
247
+ #[ cfg_attr( docsrs, doc( cfg( all( feature = "unstable" , not( feature = "send" ) ) ) ) ) ]
248
+ impl < ' lua > IntoLua < ' lua > for & OwnedThread {
249
+ #[ inline]
250
+ fn into_lua ( self , lua : & ' lua Lua ) -> Result < Value < ' lua > > {
251
+ OwnedThread :: into_lua ( self . clone ( ) , lua)
252
+ }
253
+
254
+ #[ inline]
255
+ unsafe fn push_into_stack ( self , lua : & ' lua Lua ) -> Result < ( ) > {
256
+ Ok ( lua. push_owned_ref ( & self . 0 ) )
257
+ }
258
+ }
259
+
260
+ #[ cfg( all( feature = "unstable" , any( not( feature = "send" ) , doc) ) ) ]
261
+ #[ cfg_attr( docsrs, doc( cfg( all( feature = "unstable" , not( feature = "send" ) ) ) ) ) ]
262
+ impl < ' lua > FromLua < ' lua > for OwnedThread {
263
+ #[ inline]
264
+ fn from_lua ( value : Value < ' lua > , lua : & ' lua Lua ) -> Result < OwnedThread > {
265
+ Thread :: from_lua ( value, lua) . map ( |s| s. into_owned ( ) )
266
+ }
267
+ }
268
+
235
269
impl < ' lua > IntoLua < ' lua > for AnyUserData < ' lua > {
236
270
#[ inline]
237
271
fn into_lua ( self , _: & ' lua Lua ) -> Result < Value < ' lua > > {
0 commit comments