summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNylonicious <50183564+nylonicious@users.noreply.github.com>2020-09-19 00:49:13 +0200
committerGitHub <noreply@github.com>2020-09-18 22:49:13 +0000
commit207320dbbbacb4e7c8c12f6e94f5e78eb0f055a5 (patch)
treeb4260e8fdd7f1c2a698f11ec9390b9e519f6875d
parent3fd043931e6d37f211e682980edc6e12e9d4fc54 (diff)
process: fix some docs (#2843)
* fix docs for Command::status and output Co-authored-by: Alice Ryhl <alice@ryhl.io>
-rw-r--r--tokio/src/process/mod.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs
index 9c19c72e..7da9783b 100644
--- a/tokio/src/process/mod.rs
+++ b/tokio/src/process/mod.rs
@@ -103,7 +103,7 @@
//! paradigm of dropping-implies-cancellation, a spawned process will, by
//! default, continue to execute even after the `Child` handle has been dropped.
//!
-//! The `Command::kill_on_drop` method can be used to modify this behavior
+//! The [`Command::kill_on_drop`] method can be used to modify this behavior
//! and kill the child process if the `Child` wrapper is dropped before it
//! has exited.
//!
@@ -581,8 +581,10 @@ impl Command {
/// All I/O this child does will be associated with the current default
/// event loop.
///
- /// If this future is dropped before the future resolves, then
- /// the child will be killed, if it was spawned.
+ /// The destructor of the future returned by this function will kill
+ /// the child if [`kill_on_drop`] is set to true.
+ ///
+ /// [`kill_on_drop`]: fn@Self::kill_on_drop
///
/// # Errors
///
@@ -602,6 +604,7 @@ impl Command {
/// .await
/// .expect("ls command failed to run")
/// }
+ /// ```
pub fn status(&mut self) -> impl Future<Output = io::Result<ExitStatus>> {
let child = self.spawn();
@@ -637,8 +640,10 @@ impl Command {
/// All I/O this child does will be associated with the current default
/// event loop.
///
- /// If this future is dropped before the future resolves, then
- /// the child will be killed, if it was spawned.
+ /// The destructor of the future returned by this function will kill
+ /// the child if [`kill_on_drop`] is set to true.
+ ///
+ /// [`kill_on_drop`]: fn@Self::kill_on_drop
///
/// # Examples
///
@@ -654,6 +659,7 @@ impl Command {
/// .expect("ls command failed to run");
/// println!("stderr of ls: {:?}", output.stderr);
/// }
+ /// ```
pub fn output(&mut self) -> impl Future<Output = io::Result<Output>> {
self.std.stdout(Stdio::piped());
self.std.stderr(Stdio::piped());