Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to process::Child fields #3437

Merged
merged 3 commits into from
Jan 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions tokio/src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,15 +839,38 @@ pub struct Child {
child: FusedChild,

/// The handle for writing to the child's standard input (stdin), if it has
/// been captured.
/// been captured. To avoid partially moving the `child` and thus blocking
/// yourself from calling functions on `child` while using `stdin`, you might
/// find it helpful to do:
///
/// ```no_run
/// # let mut child = tokio::process::Command::new("echo").spawn().unwrap();
/// let stdin = child.stdin.take().unwrap();
/// ```
pub stdin: Option<ChildStdin>,

/// The handle for reading from the child's standard output (stdout), if it
/// has been captured.
/// has been captured. You might find it helpful to do
///
/// ```no_run
/// # let mut child = tokio::process::Command::new("echo").spawn().unwrap();
/// let stdout = child.stdout.take().unwrap();
/// ```
///
/// to avoid partially moving the `child` and thus blocking yourself from calling
/// functions on `child` while using `stdout`.
pub stdout: Option<ChildStdout>,

/// The handle for reading from the child's standard error (stderr), if it
/// has been captured.
/// has been captured. You might find it helpful to do
///
/// ```no_run
/// # let mut child = tokio::process::Command::new("echo").spawn().unwrap();
/// let stderr = child.stderr.take().unwrap();
/// ```
///
/// to avoid partially moving the `child` and thus blocking yourself from calling
/// functions on `child` while using `stderr`.
pub stderr: Option<ChildStderr>,
}

Expand Down