33#![ stable( feature = "process_extensions" , since = "1.2.0" ) ]
44
55use crate :: ffi:: OsStr ;
6- use crate :: os:: windows:: io:: { AsRawHandle , FromRawHandle , IntoRawHandle , RawHandle } ;
6+ use crate :: os:: windows:: io:: { AsRawHandle , FromRawHandle , IntoRawHandle , OwnedHandle , RawHandle } ;
77use crate :: process;
88use crate :: sealed:: Sealed ;
99use crate :: sys;
@@ -18,6 +18,15 @@ impl FromRawHandle for process::Stdio {
1818 }
1919}
2020
21+ #[ unstable( feature = "io_safety" , issue = "87074" ) ]
22+ impl From < OwnedHandle > for process:: Stdio {
23+ fn from ( handle : OwnedHandle ) -> process:: Stdio {
24+ let handle = sys:: handle:: Handle :: from_handle ( handle) ;
25+ let io = sys:: process:: Stdio :: Handle ( handle) ;
26+ process:: Stdio :: from_inner ( io)
27+ }
28+ }
29+
2130#[ stable( feature = "process_extensions" , since = "1.2.0" ) ]
2231impl AsRawHandle for process:: Child {
2332 #[ inline]
@@ -26,13 +35,28 @@ impl AsRawHandle for process::Child {
2635 }
2736}
2837
38+ #[ unstable( feature = "io_safety" , issue = "87074" ) ]
39+ impl AsHandle for process:: Child {
40+ #[ inline]
41+ fn as_handle ( & self ) -> BorrowedHandle < ' _ > {
42+ self . as_inner ( ) . handle ( ) . as_handle ( )
43+ }
44+ }
45+
2946#[ stable( feature = "into_raw_os" , since = "1.4.0" ) ]
3047impl IntoRawHandle for process:: Child {
3148 fn into_raw_handle ( self ) -> RawHandle {
3249 self . into_inner ( ) . into_handle ( ) . into_raw_handle ( ) as * mut _
3350 }
3451}
3552
53+ #[ unstable( feature = "io_safety" , issue = "87074" ) ]
54+ impl IntoHandle for process:: Child {
55+ fn into_handle ( self ) -> BorrowedHandle < ' _ > {
56+ self . into_inner ( ) . into_handle ( ) . into_handle ( )
57+ }
58+ }
59+
3660#[ stable( feature = "process_extensions" , since = "1.2.0" ) ]
3761impl AsRawHandle for process:: ChildStdin {
3862 #[ inline]
0 commit comments