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
Implement I/O safety traits #1745
base: master
Are you sure you want to change the base?
Conversation
#[cfg(unix)] | ||
use std::os::unix::io::FromRawFd; | ||
#[cfg(target_os = "wasi")] | ||
use std::os::wasi::io::FromRawFd; | ||
#[cfg(any(unix, target_os = "wasi"))] | ||
use std::os::fd::FromRawFd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is rather new, so this change may conflict with decreasing the MSRV as discussed in #1732. Maybe just introduce your own module for this functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::os::fd
is from Rust 1.66, in #1749 we'll need a MSRV of 1.71 (?), so this won't make the difference.
Co-authored-by: ssrlive <30760636+ssrlive@users.noreply.github.com>
Instead of std::os::unix. It also works on WASM/WASI.
The AsFd, AsRawFd, FromRawFd and IntoRawFd traits. For WASI this was not implemented for all public types, now it is (matching Unix).
Mio once started with the order of std, external crates, than crate internal imports. At some points this order was not enforce properly and we ended up with a mix imports statements. This commit orders everything following imports from std, external crates, then crate internal (the `group_imports="StdExternalCrate"` rustfmt option). This has no functional change.
ba9fa9f
to
ea72027
Compare
Closes #1588