@@ -106,15 +106,18 @@ use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
106
106
pub struct Child {
107
107
handle : imp:: Process ,
108
108
109
- /// The handle for writing to the child's stdin, if it has been captured
109
+ /// The handle for writing to the child's standard input (stdin), if it has
110
+ /// been captured.
110
111
#[ stable( feature = "process" , since = "1.0.0" ) ]
111
112
pub stdin : Option < ChildStdin > ,
112
113
113
- /// The handle for reading from the child's stdout, if it has been captured
114
+ /// The handle for reading from the child's standard output (stdout), if it
115
+ /// has been captured.
114
116
#[ stable( feature = "process" , since = "1.0.0" ) ]
115
117
pub stdout : Option < ChildStdout > ,
116
118
117
- /// The handle for reading from the child's stderr, if it has been captured
119
+ /// The handle for reading from the child's standard error (stderr), if it
120
+ /// has been captured.
118
121
#[ stable( feature = "process" , since = "1.0.0" ) ]
119
122
pub stderr : Option < ChildStderr > ,
120
123
}
@@ -149,12 +152,17 @@ impl fmt::Debug for Child {
149
152
}
150
153
}
151
154
152
- /// A handle to a child process's stdin.
155
+ /// A handle to a child process's standard input ( stdin) .
153
156
///
154
157
/// This struct is used in the [`stdin`] field on [`Child`].
155
158
///
159
+ /// When an instance of `ChildStdin` is [dropped], the `ChildStdin`'s underlying
160
+ /// file handle will be closed. If the child process was blocked on input prior
161
+ /// to being dropped, it will become unblocked after dropping.
162
+ ///
156
163
/// [`Child`]: struct.Child.html
157
164
/// [`stdin`]: struct.Child.html#structfield.stdin
165
+ /// [dropped]: ../ops/trait.Drop.html
158
166
#[ stable( feature = "process" , since = "1.0.0" ) ]
159
167
pub struct ChildStdin {
160
168
inner : AnonPipe
@@ -192,12 +200,16 @@ impl fmt::Debug for ChildStdin {
192
200
}
193
201
}
194
202
195
- /// A handle to a child process's stdout.
203
+ /// A handle to a child process's standard output ( stdout) .
196
204
///
197
205
/// This struct is used in the [`stdout`] field on [`Child`].
198
206
///
207
+ /// When an instance of `ChildStdout` is [dropped], the `ChildStdout`'s
208
+ /// underlying file handle will be closed.
209
+ ///
199
210
/// [`Child`]: struct.Child.html
200
211
/// [`stdout`]: struct.Child.html#structfield.stdout
212
+ /// [dropped]: ../ops/trait.Drop.html
201
213
#[ stable( feature = "process" , since = "1.0.0" ) ]
202
214
pub struct ChildStdout {
203
215
inner : AnonPipe
@@ -239,8 +251,12 @@ impl fmt::Debug for ChildStdout {
239
251
///
240
252
/// This struct is used in the [`stderr`] field on [`Child`].
241
253
///
254
+ /// When an instance of `ChildStderr` is [dropped], the `ChildStderr`'s
255
+ /// underlying file handle will be closed.
256
+ ///
242
257
/// [`Child`]: struct.Child.html
243
258
/// [`stderr`]: struct.Child.html#structfield.stderr
259
+ /// [dropped]: ../ops/trait.Drop.html
244
260
#[ stable( feature = "process" , since = "1.0.0" ) ]
245
261
pub struct ChildStderr {
246
262
inner : AnonPipe
@@ -534,7 +550,7 @@ impl Command {
534
550
self
535
551
}
536
552
537
- /// Configuration for the child process's stdin handle (file descriptor 0) .
553
+ /// Configuration for the child process's standard input (stdin) handle .
538
554
///
539
555
/// # Examples
540
556
///
@@ -554,7 +570,7 @@ impl Command {
554
570
self
555
571
}
556
572
557
- /// Configuration for the child process's stdout handle (file descriptor 1) .
573
+ /// Configuration for the child process's standard output (stdout) handle .
558
574
///
559
575
/// # Examples
560
576
///
@@ -574,7 +590,7 @@ impl Command {
574
590
self
575
591
}
576
592
577
- /// Configuration for the child process's stderr handle (file descriptor 2) .
593
+ /// Configuration for the child process's standard error (stderr) handle .
578
594
///
579
595
/// # Examples
580
596
///
0 commit comments