Repository navigation
Tracking Issue for StdioExt #150667
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(stdio_swap)]
This is a tracking issue for the std::os::{unix, windows}::io::StdioExt extension traits
that provide ways to redirect stdio to new file handles.
Public API
// unix
pub trait StdioExt {
fn set_fd<T: Into<OwnedFd>>(&mut self, fd: T) -> io::Result<()>;
fn replace_fd<T: Into<OwnedFd>>(&mut self, replace_with: T) -> io::Result<OwnedFd>;
fn take_fd(&mut self) -> io::Result<OwnedFd>;
}
// windows
pub trait StdioExt {
fn set_handle<T: Into<OwnedHandle>>(&mut self, handle: Option<T>) -> io::Result<()>;
fn replace_handle<T: Into<OwnedHandle>>(&mut self, replace_with: T) -> io::Result<Option<BorrowedHandle<'static>>>;
fn take_handle(&mut self) -> io::Result<Option<BorrowedHandle<'static>>>;
}Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: stdio
set,closeandtakemethods libs-team#500 - Unix implementation for stdio set/take/replace #150668
- Windows implementation for stdio set/take/replace #159312
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- The windows API leaks the old handles handles because they're
essentiallyBorrowedHandle<'static>and might be in use by other threads.
This can lead to pipes not getting closed, which may be unexpected.
#t-libs > take, close and replace for stdio
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Activity
[-]Tracking Issue for XXX[/-][+]Tracking Issue for StdioExt[/+]Rollup merge of rust-lang#150668 - the8472:stdio-swap, r=Mark-Simulacrum
Rollup merge of rust-lang#150668 - the8472:stdio-swap, r=Mark-Simulacrum
Rollup merge of rust-lang#150668 - the8472:stdio-swap, r=Mark-Simulacrum
Rollup merge of rust-lang#150668 - the8472:stdio-swap, r=Mark-Simulacrum
Rollup merge of rust-lang#150668 - the8472:stdio-swap, r=Mark-Simulacrum
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Rollup merge of rust-lang#150668 - stdio-swap, r=Mark-Simulacrum,Ralf…
Unrolled build for #150668
Rollup merge of #150668 - stdio-swap, r=Mark-Simulacrum,RalfJung
Rollup merge of rust-lang#159312 - the8472:stdio-swap-win, r=ChrisDenton
Unrolled build for #159312
Rollup merge of #159312 - the8472:stdio-swap-win, r=ChrisDenton
Rollup merge of #159312 - the8472:stdio-swap-win, r=ChrisDenton