You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A possible alternative is to take the current HANDLE in windows-rs and apply a trait to it such as std::os::windows::io::AsRawHandle to convert back to the standard library types.
The challenge with the first approach is that Windows has many handle types whereas the standard library only defines HANDLE and SOCKET and even those it defines in a somewhat questionable way (handles aren't necessarily pointers and sockets are pointer-sized integers). I would however be open to exploring implementing the second alternative of implementing the standard library trait. Also related to #1622.
Right, std::os::windows::raw::HANDLE doesn't appear to be valid. There's a handle discussion here you might find fun to read #1643. There is also rust-lang/rust#95490.
Motivation
I believe it would be more consistent with rust to make use of the resources in
std::os::windows
. This includesstd::os::windows::raw::HANDLE
andstd::os::windows::raw::SOCKET
.This would make use of the standard library with windows-rs crate easier by making use of compatibility between them.
Drawbacks
None that I can see yet.
Alternatives
A possible alternative is to take the current
HANDLE
in windows-rs and apply a trait to it such asstd::os::windows::io::AsRawHandle
to convert back to the standard library types.Additional context
This is related to #760.
The text was updated successfully, but these errors were encountered: