async-net
async-net copied to clipboard
Add I/O-safe traits
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.
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.
Can we just bump up the major version with the latest MSRV?
Rewritten to use autocfg as per conversation here.
Published in 1.7.0.