Skip to content

std::process::Command misses a way to get back stdin, stdout, stderr #32394

Closed
@llogiq

Description

@llogiq

I'm not sure if this requires a RFC, but we have the StdIos within the Command, and it seems prudent not to waste them when it is dropped. So how about a function to decompose the Command into its IOs?

The following code would work (in std::process::Command):

    fn into_stdio(self) -> (Option<StdIo>, Option<StdIo>, Option<StdIo>) {
         let Command { stdin: in, stdout: out, stderr: err, .. } = self;
         (in, out, err)
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions