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

Please consider supporting AsFd #134

Closed
joshtriplett opened this issue Jun 5, 2023 · 2 comments
Closed

Please consider supporting AsFd #134

joshtriplett opened this issue Jun 5, 2023 · 2 comments

Comments

@joshtriplett
Copy link

Currently, most methods async_io::Async requires the type it wraps to implement AsRawFd, or AsRawSocket on Windows.

The standard library now supports the safe alternative AsFd (or AsSocket on Windows), and async-io has some support for this. However, it doesn't seem possible to create an Async<T> for a type that implements AsFd but not AsRawFd.

I have types I'd love to use Async with, and I'd like to drop the implementation of AsRawFd for those types. (This would also eliminate unsafe code.)

Please consider adding a constructor for Async<T> where T: AsFd.

@notgull
Copy link
Member

notgull commented Jun 6, 2023

cc smol-rs/polling#38

I definitely want to move in this direction, especially since doing this would allow us to make this crate forbid(unsafe_code) and would make things safer to use overall. The best way of doing this is to wait for Debian Bookworm to release and then bump the MSRV of this crate to 1.63.

@notgull
Copy link
Member

notgull commented Sep 11, 2023

Closed by #142

@notgull notgull closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants