-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
It's not clear when try_clone calls can fail #45536
Comments
The error conditions are OS-dependent, e.g. from Windows |
Because |
@steveklabnik I guess this issue raises about the same questions as #40322 namely: "Should we be documenting platform specific behavior and error codes)?" Maybe we should ping the libs team for this one as well? |
for windows specifically for TcpStream: Sockets. No error is returned, but the duplicate handle may not be recognized by Winsock at the target process. Also, using DuplicateHandle interferes with internal reference counting on the underlying object. To duplicate a socket handle, use the WSADuplicateSocket function. |
@steveklabnik What do you think we should do with this? Personally I find it quite clear from the context that these methods can fail (since they deal with OS primitives like sockets and files). But adding extra information in what kind of contexts they could fail would mean adding platform-specific cases. Do you think that we can close this? Or do you believe we should append something to the currently existing docs? |
Given this comment, I believe we should close this issue. |
Some types have a
try_clone
methods that returnsResult<T>
. From the documentation, it is not clear under what conditions can this call fail. Types that implement it arehttps://doc.rust-lang.org/std/?search=try_clone
The text was updated successfully, but these errors were encountered: