about summary refs log tree commit diff
path: root/src/libstd/process.rs
diff options
context:
space:
mode:
authorBryan Tan <techniux@gmail.com>2017-10-17 17:49:02 -0700
committerBryan Tan <techniux@gmail.com>2017-10-17 17:49:02 -0700
commit3566832ef3a5af2ee29a76f95b55c6e1fafcf02a (patch)
treef330ebf36ed7de4f03877e44812c16ce5c575ffb /src/libstd/process.rs
parentf67f6622b37bca1b2430ab2987d94d31ad436762 (diff)
downloadrust-3566832ef3a5af2ee29a76f95b55c6e1fafcf02a.tar.gz
rust-3566832ef3a5af2ee29a76f95b55c6e1fafcf02a.zip
Add child process IO handling docs
Diffstat (limited to 'src/libstd/process.rs')
-rw-r--r--src/libstd/process.rs25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 72402aaae30..bcdbee52ca3 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -36,11 +36,11 @@
 //!
 //! # Handling I/O
 //!
-//! TODO
-//!
-//! # Examples
-//!
-//! Piping output from one command into another command:
+//! The [`stdout`], [`stdin`], and [`stderr`] of a child process can be
+//! configured by passing an [`Stdio`] to the corresponding method on
+//! [`Command`]. Once spawned, they can be accessed from the [`Child`]. For
+//! example, piping output from one command into another command can be done
+//! like so:
 //!
 //! ```
 //! use std::process::{Command, Stdio};
@@ -68,9 +68,10 @@
 //! assert_eq!(b"Oh no, a typo!\n", output.stdout.as_slice());
 //! ```
 //!
-//! Calling a command with input and reading its output:
+//! Note that [`ChildStderr`] and [`ChildStdout`] implement [`Write`] and
+//! [`ChildStdin`] implements [`Read`]:
 //!
-//! ```no_run
+//! ```
 //! use std::process::{Command, Stdio};
 //! use std::io::Write;
 //!
@@ -101,7 +102,17 @@
 //! [`output`]: struct.Command.html#method.output
 //!
 //! [`Child`]: struct.Child.html
+//! [`ChildStdin`]: struct.ChildStdin.html
+//! [`ChildStdout`]: struct.ChildStdout.html
+//! [`ChildStderr`]: struct.ChildStderr.html
 //! [`Stdio`]: struct.Stdio.html
+//!
+//! [`stdout`]: struct.Command.html#method.stdout
+//! [`stdin`]: struct.Command.html#method.stdin
+//! [`stderr`]: struct.Command.html#method.stderr
+//!
+//! [`Write`]: ../io/trait.Write.html
+//! [`Read`]: ../io/trait.Read.html
 
 #![stable(feature = "process", since = "1.0.0")]