about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorVincent Thiberville <vthib@pm.me>2023-03-09 10:46:38 +0100
committerVincent Thiberville <vthib@pm.me>2023-05-30 15:39:43 +0200
commit9de32a7a3b7928b3679118cf423fd69246de8784 (patch)
tree1a3c4f434ccb10677a9680d65a5533778a367e3a /library/std
parent7ebbdc6e3b8c8cec8dc78c20f961c4fae415a5a0 (diff)
downloadrust-9de32a7a3b7928b3679118cf423fd69246de8784.tar.gz
rust-9de32a7a3b7928b3679118cf423fd69246de8784.zip
add doc on From<OwnedFd/Handle> impl for ChildStd*
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/os/unix/process.rs12
-rw-r--r--library/std/src/os/windows/process.rs12
2 files changed, 24 insertions, 0 deletions
diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs
index 5c1841016f4..95f10bcb04e 100644
--- a/library/std/src/os/unix/process.rs
+++ b/library/std/src/os/unix/process.rs
@@ -434,6 +434,10 @@ impl From<crate::process::ChildStdin> for OwnedFd {
     }
 }
 
+/// Create a `ChildStdin` from the provided `OwnedFd`.
+///
+/// The provided file descriptor must point to a pipe
+/// with the `CLOEXEC` flag set.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedFd> for process::ChildStdin {
     #[inline]
@@ -460,6 +464,10 @@ impl From<crate::process::ChildStdout> for OwnedFd {
     }
 }
 
+/// Create a `ChildStdout` from the provided `OwnedFd`.
+///
+/// The provided file descriptor must point to a pipe
+/// with the `CLOEXEC` flag set.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedFd> for process::ChildStdout {
     #[inline]
@@ -486,6 +494,10 @@ impl From<crate::process::ChildStderr> for OwnedFd {
     }
 }
 
+/// Create a `ChildStderr` from the provided `OwnedFd`.
+///
+/// The provided file descriptor must point to a pipe
+/// with the `CLOEXEC` flag set.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedFd> for process::ChildStderr {
     #[inline]
diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs
index 719b804ac19..2f989a77f14 100644
--- a/library/std/src/os/windows/process.rs
+++ b/library/std/src/os/windows/process.rs
@@ -106,6 +106,10 @@ impl IntoRawHandle for process::ChildStderr {
     }
 }
 
+/// Create a `ChildStdin` from the provided `OwnedHandle`.
+///
+/// The provided handle must be asynchronous, as reading and
+/// writing from and to it is implemented using asynchronous APIs.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedHandle> for process::ChildStdin {
     fn from(handle: OwnedHandle) -> process::ChildStdin {
@@ -115,6 +119,10 @@ impl From<OwnedHandle> for process::ChildStdin {
     }
 }
 
+/// Create a `ChildStdout` from the provided `OwnedHandle`.
+///
+/// The provided handle must be asynchronous, as reading and
+/// writing from and to it is implemented using asynchronous APIs.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedHandle> for process::ChildStdout {
     fn from(handle: OwnedHandle) -> process::ChildStdout {
@@ -124,6 +132,10 @@ impl From<OwnedHandle> for process::ChildStdout {
     }
 }
 
+/// Create a `ChildStderr` from the provided `OwnedHandle`.
+///
+/// The provided handle must be asynchronous, as reading and
+/// writing from and to it is implemented using asynchronous APIs.
 #[stable(feature = "io_safety", since = "1.63.0")]
 impl From<OwnedHandle> for process::ChildStderr {
     fn from(handle: OwnedHandle) -> process::ChildStderr {