Skip to content

Commit 8b93147

Browse files
committed
Stdio::make_pipe
1 parent 10d9ecd commit 8b93147

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

library/std/src/process.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,22 @@ impl Stdio {
12731273
pub fn null() -> Stdio {
12741274
Stdio(imp::Stdio::Null)
12751275
}
1276+
1277+
/// Returns `true` if this requires [`Command`] to create a new pipe.
1278+
///
1279+
/// # Example
1280+
///
1281+
/// ```
1282+
/// #![feature(stdio_makes_pipe)]
1283+
/// use std::process::Stdio;
1284+
///
1285+
/// let io = Stdio::piped();
1286+
/// assert_eq!(io.makes_pipe(), true);
1287+
/// ```
1288+
#[unstable(feature = "stdio_makes_pipe", issue = "98288")]
1289+
pub fn makes_pipe(&self) -> bool {
1290+
matches!(self.0, imp::Stdio::MakePipe)
1291+
}
12761292
}
12771293

12781294
impl FromInner<imp::Stdio> for Stdio {

0 commit comments

Comments
 (0)