Skip to content

Commit

Permalink
Stdio::make_pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Jun 20, 2022
1 parent 10d9ecd commit 8b93147
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8b93147

Please sign in to comment.