Skip to content

AsyncRead and AsyncWrite implementations for &TcpStream #5

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

Closed
abhishekc-sharma opened this issue Oct 25, 2020 · 2 comments
Closed

AsyncRead and AsyncWrite implementations for &TcpStream #5

abhishekc-sharma opened this issue Oct 25, 2020 · 2 comments

Comments

@abhishekc-sharma
Copy link

I would like to understand if there a particular reason why the API for async_net::TcpStream does not mirror the API provided by std::TcpStream or Async by not implementing the AsyncRead and AsyncRead for shared references. I suppose I could still do this by using the Into<Arc<Async<TcpStream>>> implementation and using the implementations on that.

@ghost
Copy link

ghost commented Oct 25, 2020

Alternatively, instead of using references, you can just clone the TcpStream.

@abhishekc-sharma
Copy link
Author

Whoops ! Somehow didn't see that it is Clone. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant