]> git.lizzy.rs Git - rust.git/commit
Add conversions from File and Child* handles to Stdio
authorJosh Stone <jistone@redhat.com>
Tue, 6 Jun 2017 22:42:55 +0000 (15:42 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 6 Jun 2017 22:42:55 +0000 (15:42 -0700)
commit9debe91675222782e08fbb15bb6359a05bf85131
tree3bc0a130617f2cc0675f47b1647da77e00738412
parenta032cb89c5d9b436c1c57f8a6d5961d898f5c2b6
Add conversions from File and Child* handles to Stdio

`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`,
`From<ChildStderr>`, and `From<File>`.

The `Command::stdin`/`stdout`/`stderr` methods now take any type that
implements `Into<Stdio>`.

This makes it much easier to write shell-like command chains, piping to
one another and redirecting to and from files.  Otherwise one would need
to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.
src/libstd/process.rs
src/libstd/sys/redox/process.rs
src/libstd/sys/unix/process/process_common.rs
src/libstd/sys/windows/process.rs
src/test/run-pass-fulldeps/stdio-from.rs [new file with mode: 0644]
src/test/run-pass/issue-30490.rs