WIP: Implement FromRawFd for TcpStreamNew#87
WIP: Implement FromRawFd for TcpStreamNew#87rushmorem wants to merge 2 commits intotokio-rs:masterfrom
Conversation
Implements `std::os::unix::io::FromRawFd` for `net::TcpStreamNew`. This should make it easier to utilise futures on existing connections. This pull request builds on top of tokio-rs#84 so if both are desirable you can just merge this one and close tokio-rs#84.
|
Thanks for the PR! I'd be pretty wary about adding an impl like this which can so easily and silently fail. This was also in theory the purpose of the |
|
Sometimes this is the only way to convert an existing Having said that, this implementation will not work because of it's reliance on #84. Instead of implementing |
|
Yeah passing an explicit handle sounds good to me, but I'm not sure I quite follow why |
|
That's just the thing! |
|
Hm ok so you claimed:
If all you have is a borrow, it's not safe to call this function. So if all you have is a borrow, you can never create a In light of that the |
|
We can't create a As for safety, yes this function is
The signature of the function ( |
|
No the |
|
I believe this is largely subsumed by |
Don't store an Arc in ReadinessStream
Implements
std::os::unix::io::FromRawFdfornet::TcpStreamNew.This should make it easier to utilise futures on existing connections.
This pull request builds on top of #84
so if both are desirable you can just merge this one and close
#84.