-
Notifications
You must be signed in to change notification settings - Fork 139
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 #134
Conversation
src/util.rs
Outdated
} else { | ||
Err(()) | ||
/// An owned file descriptor. | ||
pub struct Fd(pub OwnedFd); |
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.
I would make io_uring
use OwnedFd
directly.
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.
What is this project's MSRV? I use the Fd
wrapper to choose between OwnedFd
and a version compatible with older versions of Rust. Using OwnedFd
directly would bump the MSRV to 1.63.
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.
Don't have an explicit MSRV, but I really don't want to chase a compiler version that's too new.
We still have to provide a fallback impl, but the interface should be consistent with OwnedFd
. After 1.63 is old enough, we can delete this fallback impl directly.
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.
LGTM
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.
Looks like we also need to fix fmt
This pull request adds a new
io_safety
feature that uses theAsFd
trait from Rust 1.63. In addition, theFd
utility type is implemented usingOwnedFd
for its niching.See also: sunfishcode/io-lifetimes#38