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 and try_recv_buf #3313

Closed
Darksonn opened this issue Dec 22, 2020 · 2 comments
Closed

Add try_read_buf and try_recv_buf #3313

Darksonn opened this issue Dec 22, 2020 · 2 comments
Labels
A-tokio Area: The main tokio crate C-feature-accepted Category: A feature request that has been accepted pending implementation. C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net

Comments

@Darksonn
Copy link
Contributor

Darksonn commented Dec 22, 2020

Add _buf variants of the try_recv methods on TcpStream, UnixStream, UdpSocket and UnixSocket. These methods should have a signature similar to AsyncReadExt::read_buf like this:

pub fn try_read_buf<B>(&self, buf: &mut B) -> io::Result<usize>;

For TcpStream and UnixStream, the method should support reading into uninitialized memory. For UdpSocket and UnixSocket, they should support receiving messages into uninitialized memory.

@Darksonn Darksonn added E-help-wanted Call for participation: Help is requested to fix this issue. A-tokio Area: The main tokio crate M-net Module: tokio/net C-feature-request Category: A feature request. C-feature-accepted Category: A feature request that has been accepted pending implementation. labels Dec 22, 2020
@Rustin170506
Copy link
Contributor

Can I work on this?

@Darksonn
Copy link
Contributor Author

Sure, go ahead.

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-accepted Category: A feature request that has been accepted pending implementation. C-feature-request Category: A feature request. E-help-wanted Call for participation: Help is requested to fix this issue. M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests

2 participants