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

Implement I/O safety traits #1745

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Implement I/O safety traits #1745

wants to merge 8 commits into from

Conversation

Thomasdezeeuw
Copy link
Collaborator

Closes #1588

This was referenced Dec 23, 2023
Comment on lines -22 to +24
#[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;
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Thomasdezeeuw and others added 7 commits February 24, 2024 08:57
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.
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 this pull request may close these issues.

Migrate to I/O safety traits
2 participants