about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2022-05-18 20:14:29 +0100
committerChris Denton <christophersdenton@gmail.com>2022-06-20 11:58:38 +0100
commit8b93147f7e1805a8910f0d593aacf87f539a1280 (patch)
tree09f63d31ffac2a67426486d96540d828f563fb6e
parent10d9ecda48f828e174d7a863fc43a155ad086efd (diff)
downloadrust-8b93147f7e1805a8910f0d593aacf87f539a1280.tar.gz
rust-8b93147f7e1805a8910f0d593aacf87f539a1280.zip
`Stdio::make_pipe`
-rw-r--r--library/std/src/process.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index e253f46406f..567a424d8f0 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -1273,6 +1273,22 @@ impl Stdio {
     pub fn null() -> Stdio {
         Stdio(imp::Stdio::Null)
     }
+
+    /// Returns `true` if this requires [`Command`] to create a new pipe.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// #![feature(stdio_makes_pipe)]
+    /// use std::process::Stdio;
+    ///
+    /// let io = Stdio::piped();
+    /// assert_eq!(io.makes_pipe(), true);
+    /// ```
+    #[unstable(feature = "stdio_makes_pipe", issue = "98288")]
+    pub fn makes_pipe(&self) -> bool {
+        matches!(self.0, imp::Stdio::MakePipe)
+    }
 }
 
 impl FromInner<imp::Stdio> for Stdio {