Skip to content

Commit 9de32a7

Browse files
committed
add doc on From<OwnedFd/Handle> impl for ChildStd*
1 parent 7ebbdc6 commit 9de32a7

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

library/std/src/os/unix/process.rs

+12
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ impl From<crate::process::ChildStdin> for OwnedFd {
434434
}
435435
}
436436

437+
/// Create a `ChildStdin` from the provided `OwnedFd`.
438+
///
439+
/// The provided file descriptor must point to a pipe
440+
/// with the `CLOEXEC` flag set.
437441
#[stable(feature = "io_safety", since = "1.63.0")]
438442
impl From<OwnedFd> for process::ChildStdin {
439443
#[inline]
@@ -460,6 +464,10 @@ impl From<crate::process::ChildStdout> for OwnedFd {
460464
}
461465
}
462466

467+
/// Create a `ChildStdout` from the provided `OwnedFd`.
468+
///
469+
/// The provided file descriptor must point to a pipe
470+
/// with the `CLOEXEC` flag set.
463471
#[stable(feature = "io_safety", since = "1.63.0")]
464472
impl From<OwnedFd> for process::ChildStdout {
465473
#[inline]
@@ -486,6 +494,10 @@ impl From<crate::process::ChildStderr> for OwnedFd {
486494
}
487495
}
488496

497+
/// Create a `ChildStderr` from the provided `OwnedFd`.
498+
///
499+
/// The provided file descriptor must point to a pipe
500+
/// with the `CLOEXEC` flag set.
489501
#[stable(feature = "io_safety", since = "1.63.0")]
490502
impl From<OwnedFd> for process::ChildStderr {
491503
#[inline]

library/std/src/os/windows/process.rs

+12
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ impl IntoRawHandle for process::ChildStderr {
106106
}
107107
}
108108

109+
/// Create a `ChildStdin` from the provided `OwnedHandle`.
110+
///
111+
/// The provided handle must be asynchronous, as reading and
112+
/// writing from and to it is implemented using asynchronous APIs.
109113
#[stable(feature = "io_safety", since = "1.63.0")]
110114
impl From<OwnedHandle> for process::ChildStdin {
111115
fn from(handle: OwnedHandle) -> process::ChildStdin {
@@ -115,6 +119,10 @@ impl From<OwnedHandle> for process::ChildStdin {
115119
}
116120
}
117121

122+
/// Create a `ChildStdout` from the provided `OwnedHandle`.
123+
///
124+
/// The provided handle must be asynchronous, as reading and
125+
/// writing from and to it is implemented using asynchronous APIs.
118126
#[stable(feature = "io_safety", since = "1.63.0")]
119127
impl From<OwnedHandle> for process::ChildStdout {
120128
fn from(handle: OwnedHandle) -> process::ChildStdout {
@@ -124,6 +132,10 @@ impl From<OwnedHandle> for process::ChildStdout {
124132
}
125133
}
126134

135+
/// Create a `ChildStderr` from the provided `OwnedHandle`.
136+
///
137+
/// The provided handle must be asynchronous, as reading and
138+
/// writing from and to it is implemented using asynchronous APIs.
127139
#[stable(feature = "io_safety", since = "1.63.0")]
128140
impl From<OwnedHandle> for process::ChildStderr {
129141
fn from(handle: OwnedHandle) -> process::ChildStderr {

0 commit comments

Comments
 (0)