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 try_read_buf to net::windows::named_pipe::NamedPipeClient #4602

Closed
cptpiepmatz opened this issue Apr 6, 2022 · 3 comments · Fixed by #4626
Closed

Add try_read_buf to net::windows::named_pipe::NamedPipeClient #4602

cptpiepmatz opened this issue Apr 6, 2022 · 3 comments · Fixed by #4626
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net

Comments

@cptpiepmatz
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The net::TcpStream does have a try_read_buf method that takes a bytes::buf::BufMut to read data in.
The net::windows::named_pipe::NamedPipeClient is missing such method.

Describe the solution you'd like
A try_read_buf method with the same signature as the TcpStream.

Describe alternatives you've considered
Alternatively the read_buf from the io::AsyncReadExt trait may be used, that one is async, while try_read_buf usually isn't.

Additional context
@Darksonn asked me to submit this issue.

@cptpiepmatz cptpiepmatz added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Apr 6, 2022
@Darksonn Darksonn added E-help-wanted Call for participation: Help is requested to fix this issue. E-easy Call for participation: Experience needed to fix: Easy / not much M-net Module: tokio/net labels Apr 6, 2022
@Darksonn
Copy link
Contributor

Darksonn commented Apr 6, 2022

Adding this method should be relatively easy. It should be identical to the one on TcpStream.

@acalhoon
Copy link

acalhoon commented Apr 6, 2022

I'm not a contributor yet but am willing to look into this

@Darksonn
Copy link
Contributor

Darksonn commented Apr 7, 2022

@acalhoon Go ahead and submit a PR!

cptpiepmatz added a commit to cptpiepmatz/tokio that referenced this issue Apr 18, 2022
This is simply a copy from TcpStream or UnixStream.

Fixes: tokio-rs#4602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-feature-request Category: A feature request. E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants