1
- use crate :: io:: { self , PipeReader , PipeWriter } ;
2
- use crate :: os:: windows:: io:: {
3
- AsHandle , AsRawHandle , BorrowedHandle , FromRawHandle , IntoRawHandle , OwnedHandle , RawHandle ,
4
- } ;
5
- use crate :: process:: Stdio ;
6
- use crate :: ptr;
1
+ use crate :: os:: windows:: io:: FromRawHandle ;
7
2
use crate :: sys:: c;
8
3
use crate :: sys:: handle:: Handle ;
9
- use crate :: sys_common :: { FromInner , IntoInner } ;
4
+ use crate :: { io , ptr } ;
10
5
11
6
pub type AnonPipe = Handle ;
12
7
@@ -22,95 +17,3 @@ pub fn pipe() -> io::Result<(AnonPipe, AnonPipe)> {
22
17
unsafe { Ok ( ( Handle :: from_raw_handle ( read_pipe) , Handle :: from_raw_handle ( write_pipe) ) ) }
23
18
}
24
19
}
25
-
26
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
27
- impl AsHandle for PipeReader {
28
- fn as_handle ( & self ) -> BorrowedHandle < ' _ > {
29
- self . 0 . as_handle ( )
30
- }
31
- }
32
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
33
- impl AsRawHandle for PipeReader {
34
- fn as_raw_handle ( & self ) -> RawHandle {
35
- self . 0 . as_raw_handle ( )
36
- }
37
- }
38
-
39
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
40
- impl FromRawHandle for PipeReader {
41
- unsafe fn from_raw_handle ( raw_handle : RawHandle ) -> Self {
42
- unsafe { Self ( Handle :: from_raw_handle ( raw_handle) ) }
43
- }
44
- }
45
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
46
- impl IntoRawHandle for PipeReader {
47
- fn into_raw_handle ( self ) -> RawHandle {
48
- self . 0 . into_raw_handle ( )
49
- }
50
- }
51
-
52
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
53
- impl From < PipeReader > for OwnedHandle {
54
- fn from ( pipe : PipeReader ) -> Self {
55
- Handle :: into_inner ( pipe. 0 )
56
- }
57
- }
58
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
59
- impl From < PipeReader > for Stdio {
60
- fn from ( pipe : PipeReader ) -> Self {
61
- Self :: from ( OwnedHandle :: from ( pipe) )
62
- }
63
- }
64
-
65
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
66
- impl AsHandle for PipeWriter {
67
- fn as_handle ( & self ) -> BorrowedHandle < ' _ > {
68
- self . 0 . as_handle ( )
69
- }
70
- }
71
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
72
- impl AsRawHandle for PipeWriter {
73
- fn as_raw_handle ( & self ) -> RawHandle {
74
- self . 0 . as_raw_handle ( )
75
- }
76
- }
77
-
78
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
79
- impl FromRawHandle for PipeWriter {
80
- unsafe fn from_raw_handle ( raw_handle : RawHandle ) -> Self {
81
- unsafe { Self ( Handle :: from_raw_handle ( raw_handle) ) }
82
- }
83
- }
84
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
85
- impl IntoRawHandle for PipeWriter {
86
- fn into_raw_handle ( self ) -> RawHandle {
87
- self . 0 . into_raw_handle ( )
88
- }
89
- }
90
-
91
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
92
- impl From < PipeWriter > for OwnedHandle {
93
- fn from ( pipe : PipeWriter ) -> Self {
94
- Handle :: into_inner ( pipe. 0 )
95
- }
96
- }
97
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
98
- impl From < PipeWriter > for Stdio {
99
- fn from ( pipe : PipeWriter ) -> Self {
100
- Self :: from ( OwnedHandle :: from ( pipe) )
101
- }
102
- }
103
-
104
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
105
- impl From < OwnedHandle > for PipeReader {
106
- fn from ( owned_handle : OwnedHandle ) -> Self {
107
- Self ( Handle :: from_inner ( owned_handle) )
108
- }
109
- }
110
-
111
- #[ stable( feature = "anonymous_pipe" , since = "CURRENT_RUSTC_VERSION" ) ]
112
- impl From < OwnedHandle > for PipeWriter {
113
- fn from ( owned_handle : OwnedHandle ) -> Self {
114
- Self ( Handle :: from_inner ( owned_handle) )
115
- }
116
- }
0 commit comments