add doc on From<OwnedFd/Handle> impl for ChildStd*

This commit is contained in:
Vincent Thiberville 2023-03-09 10:46:38 +01:00
parent 7ebbdc6e3b
commit 9de32a7a3b
2 changed files with 24 additions and 0 deletions

View file

@ -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]

View file

@ -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 {