Skip to content

Conversation

notgull
Copy link
Member

@notgull notgull commented Aug 11, 2022

This PR implements AsFd and AsSocket for Async<T>. In addition, TryFrom<OwnedFd/OwnedSocket is implemented for Async<T> and TryFrom<Async<T>> is implemented for OwnedFd/OwnedSocket, in order to mirror the From/Into<OwnedFd/OwnedSocket> impls in std but also considering that the operations are fallible in async-io.

See also: sunfishcode/io-lifetimes#38

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! This looks good to me.

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!

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

taiki-e commented Aug 17, 2022

Published in 1.8.0.

jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 4, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with a
cfg(has_pipe), and use autocfg to set has_pipe, like was done in a20076f
("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 4, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with a
cfg(has_pipe), and use autocfg to set has_pipe, like was done in a20076f
("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 4, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availbility, similar to what was done
in a20076f ("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 4, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availbility, similar to what was done
in a20076f ("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 4, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availbility, similar to what was done
in a20076f ("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 5, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availbility, similar to what was done
in a20076f ("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
jk-ozlabs added a commit to jk-ozlabs/async-io that referenced this pull request Aug 5, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availbility, similar to what was done
in a20076f ("Implement I/O-safe traits (smol-rs#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
taiki-e pushed a commit that referenced this pull request Aug 5, 2025
It would be handy to have async wrappers for the pipe types (from
std::io::pipe()), so impl IoSafe for both.

The pipe types were introduced in 1.87, but the MSRV for async-io
appears to be 1.63 currently. So, protect the impls with cfg()s
and use autocfg to detect the type availability, similar to what was done
in a20076f ("Implement I/O-safe traits (#84)")

Signed-off-by: Jeremy Kerr <[email protected]>
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.

2 participants