Skip to content

Commit 97d96bd

Browse files
committed
std::process doc improvements.
* Link to `process::Command` from `process::Child`. * Move out inline Markdown link in doc comment. * Link to `process::Child::wait` from `process::Child`. * Link to `process::Child` from `process::ChildStdin`. * Link to `process::Child` from `process::ChildStdout`. * Link to `process::Child` from `process::ChildStderr`.
1 parent 46e7f4b commit 97d96bd

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

src/libstd/process.rs

+29-11
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
2727
/// Representation of a running or exited child process.
2828
///
2929
/// This structure is used to represent and manage child processes. A child
30-
/// process is created via the `Command` struct, which configures the spawning
31-
/// process and can itself be constructed using a builder-style interface.
30+
/// process is created via the [`Command`] struct, which configures the
31+
/// spawning process and can itself be constructed using a builder-style
32+
/// interface.
3233
///
3334
/// # Examples
3435
///
@@ -48,13 +49,18 @@ use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
4849
///
4950
/// # Note
5051
///
51-
/// Take note that there is no implementation of
52-
/// [`Drop`](../../core/ops/trait.Drop.html) for child processes, so if you
53-
/// do not ensure the `Child` has exited then it will continue to run, even
54-
/// after the `Child` handle to the child process has gone out of scope.
52+
/// Take note that there is no implementation of [`Drop`] for child processes,
53+
/// so if you do not ensure the `Child` has exited then it will continue to
54+
/// run, even after the `Child` handle to the child process has gone out of
55+
/// scope.
5556
///
56-
/// Calling `wait` (or other functions that wrap around it) will make the
57-
/// parent process wait until the child has actually exited before continuing.
57+
/// Calling [`wait`][`wait`] (or other functions that wrap around it) will make
58+
/// the parent process wait until the child has actually exited before
59+
/// continuing.
60+
///
61+
/// [`Command`]: struct.Command.html
62+
/// [`Drop`]: ../../core/ops/trait.Drop.html
63+
/// [`wait`]: #method.wait
5864
#[stable(feature = "process", since = "1.0.0")]
5965
pub struct Child {
6066
handle: imp::Process,
@@ -91,7 +97,11 @@ impl IntoInner<imp::Process> for Child {
9197
fn into_inner(self) -> imp::Process { self.handle }
9298
}
9399

94-
/// A handle to a child process's stdin
100+
/// A handle to a child process's stdin. This struct is used in the [`stdin`]
101+
/// field on [`Child`].
102+
///
103+
/// [`Child`]: struct.Child.html
104+
/// [`stdin`]: struct.Child.html#structfield.stdin
95105
#[stable(feature = "process", since = "1.0.0")]
96106
pub struct ChildStdin {
97107
inner: AnonPipe
@@ -122,7 +132,11 @@ impl FromInner<AnonPipe> for ChildStdin {
122132
}
123133
}
124134

125-
/// A handle to a child process's stdout
135+
/// A handle to a child process's stdout. This struct is used in the [`stdout`]
136+
/// field on [`Child`].
137+
///
138+
/// [`Child`]: struct.Child.html
139+
/// [`stdout`]: struct.Child.html#structfield.stdout
126140
#[stable(feature = "process", since = "1.0.0")]
127141
pub struct ChildStdout {
128142
inner: AnonPipe
@@ -152,7 +166,11 @@ impl FromInner<AnonPipe> for ChildStdout {
152166
}
153167
}
154168

155-
/// A handle to a child process's stderr
169+
/// A handle to a child process's stderr. This struct is used in the [`stderr`]
170+
/// field on [`Child`].
171+
///
172+
/// [`Child`]: struct.Child.html
173+
/// [`stderr`]: struct.Child.html#structfield.stderr
156174
#[stable(feature = "process", since = "1.0.0")]
157175
pub struct ChildStderr {
158176
inner: AnonPipe

0 commit comments

Comments
 (0)