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

Add I/O-safe traits #21

Merged
merged 4 commits into from
Aug 17, 2022
Merged

Add I/O-safe traits #21

merged 4 commits into from
Aug 17, 2022

Conversation

notgull
Copy link
Member

@notgull notgull commented Aug 11, 2022

This PR adds a new feature, io_safety, which requires Rust 1.63. With this feature, the types in this crate implement AsFd/AsSocket and TryFrom<OwnedFd/OwnedSocket>.

See also: sunfishcode/io-lifetimes#38

Should I also implement TryInto<OwnedFd/OwnedSocket> on these types? It would involve unwrapping the Arc, which doesn't feel idiomatic, but it would complete the symmetry with std.

Copy link
Collaborator

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Cargo.toml Outdated Show resolved Hide resolved
@taiki-e
Copy link
Collaborator

taiki-e commented Aug 12, 2022

Should I also implement TryInto<OwnedFd/OwnedSocket> on these types? It would involve unwrapping the Arc, which doesn't feel idiomatic, but it would complete the symmetry with std.

Depending on how the standard library implements them, if we cannot provide the same behavior, I prefer not to do this since we are not providing the same API anyway.

@sehz
Copy link

sehz commented Aug 12, 2022

Can we just bump up the major version with the latest MSRV?

@notgull
Copy link
Member Author

notgull commented Aug 15, 2022

Rewritten to use autocfg as per conversation here.

Copy link
Collaborator

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@taiki-e taiki-e merged commit f54163f into smol-rs:master Aug 17, 2022
@taiki-e
Copy link
Collaborator

taiki-e commented Aug 17, 2022

Published in 1.7.0.

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

Successfully merging this pull request may close these issues.

3 participants