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

Various std::process doc improvements. #34737

Merged
merged 1 commit into from
Jul 12, 2016
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
40 changes: 29 additions & 11 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
/// Representation of a running or exited child process.
///
/// This structure is used to represent and manage child processes. A child
/// process is created via the `Command` struct, which configures the spawning
/// process and can itself be constructed using a builder-style interface.
/// process is created via the [`Command`] struct, which configures the
/// spawning process and can itself be constructed using a builder-style
/// interface.
///
/// # Examples
///
Expand All @@ -48,13 +49,18 @@ use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
///
/// # Note
///
/// Take note that there is no implementation of
/// [`Drop`](../../core/ops/trait.Drop.html) for child processes, so if you
/// do not ensure the `Child` has exited then it will continue to run, even
/// after the `Child` handle to the child process has gone out of scope.
/// Take note that there is no implementation of [`Drop`] for child processes,
/// so if you do not ensure the `Child` has exited then it will continue to
/// run, even after the `Child` handle to the child process has gone out of
/// scope.
///
/// Calling `wait` (or other functions that wrap around it) will make the
/// parent process wait until the child has actually exited before continuing.
/// Calling [`wait`][`wait`] (or other functions that wrap around it) will make
/// the parent process wait until the child has actually exited before
/// continuing.
///
/// [`Command`]: struct.Command.html
/// [`Drop`]: ../../core/ops/trait.Drop.html
/// [`wait`]: #method.wait
#[stable(feature = "process", since = "1.0.0")]
pub struct Child {
handle: imp::Process,
Expand Down Expand Up @@ -91,7 +97,11 @@ impl IntoInner<imp::Process> for Child {
fn into_inner(self) -> imp::Process { self.handle }
}

/// A handle to a child process's stdin
/// A handle to a child process's stdin. This struct is used in the [`stdin`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an english native but I'm pretty sure you don't write "process's" but "process'". But maybe I'm wrong so please correct me if this is the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally say process's, but I might be wrong and English is weird.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. It doesn't help. 😆

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process's is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then my bad!

/// field on [`Child`].
///
/// [`Child`]: struct.Child.html
/// [`stdin`]: struct.Child.html#structfield.stdin
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStdin {
inner: AnonPipe
Expand Down Expand Up @@ -122,7 +132,11 @@ impl FromInner<AnonPipe> for ChildStdin {
}
}

/// A handle to a child process's stdout
/// A handle to a child process's stdout. This struct is used in the [`stdout`]
/// field on [`Child`].
///
/// [`Child`]: struct.Child.html
/// [`stdout`]: struct.Child.html#structfield.stdout
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStdout {
inner: AnonPipe
Expand Down Expand Up @@ -152,7 +166,11 @@ impl FromInner<AnonPipe> for ChildStdout {
}
}

/// A handle to a child process's stderr
/// A handle to a child process's stderr. This struct is used in the [`stderr`]
/// field on [`Child`].
///
/// [`Child`]: struct.Child.html
/// [`stderr`]: struct.Child.html#structfield.stderr
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStderr {
inner: AnonPipe
Expand Down