-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 try_*, readable, writable, ready, and peer_addr methods to TCP and Unix split halves #4120
Add try_*, readable, writable, ready, and peer_addr methods to TCP and Unix split halves #4120
Conversation
…d unix split halves Also adds a doc test to UnixStream::peer_addr().
This should resolve #4098 |
I decided it wouldn't make a ton of sense not to just add the local_addr method as well, since I'm already adding peer_addr. |
Honestly, now that I see how massive this change is, I wonder if we should change course and instead write some documentation that explains how you can call methods on the underlying IO resource. |
Every time we've added a new |
I've removed the examples, it's no longer nearly as large of a change |
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
@Darksonn I've gone through and addressed the documentation issues. |
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
…h/read-write-halves
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.
Thanks.
…thods to split halves (tokio-rs#4120)
Motivation
Currently, Tokio's split halves APIs leave out a lot of fairly useful methods from TcpStream and UnixStream.
Solution
This PR adds the try_*, readable, writable, ready, and peer_addr methods to the split halves APIs for TcpStream and UnixStream.
This PR also adds a doc example for the UnixStream-related peer_addr methods.
Closes: #4098