]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/process.rs
Auto merge of #96820 - r-raymond:master, r=cuviper
[rust.git] / library / std / src / process.rs
index da8eee9030b908bfd975bfb08af9e12ef15f94de..ab1a1e6c76fa4566c02aea580114d673e64150d8 100644 (file)
@@ -1273,6 +1273,22 @@ pub fn inherit() -> 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 {