Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: allow acces to RawFd for tokio::io::Stdout #2311

Closed
MarinPostma opened this issue Mar 10, 2020 · 1 comment · Fixed by #2335
Closed

Proposal: allow acces to RawFd for tokio::io::Stdout #2311

MarinPostma opened this issue Mar 10, 2020 · 1 comment · Fixed by #2335

Comments

@MarinPostma
Copy link
Contributor

Version

I am currently using 0.2.13, and this feature mostly relate to io

Platform

Linux march 5.5.7-arch1-1 #1 SMP PREEMPT Sat, 29 Feb 2020 19:06:02 +0000 x86_64 GNU/Linux

Description

It is often necessary to manipulate Stdout in unix, for example to set a terminal in raw mode. For this a RawFd in necessary. It would be useful for tokio::io::Stdout to implement AsRawFd. Rust's std::io::Stdout implements it, and tokio::fs::File does too (#674, #1364). For sake of completeness, maybe Stdin should implement it too.
I don't know of the equivalent for Window, but it may be interesting to investigate there too.

@kleimkuhler
Copy link
Contributor

@MarinPostma This seems reasonable especially since std has the implementations.

Windows has an equivalent AsRawHandle trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants