Creates I/O objects from raw sockets.
Constructs a new I/O object from the specified raw socket.
This function is typically used to consume ownership of the socket given, passing responsibility for closing the socket to the returned object. When used in this way, the returned object will take responsibility for closing it when the object goes out of scope.
However, consuming ownership is not strictly required. Use a
From<OwnedSocket>::from implementation for an API which strictly
socket passed in must:
- be a valid an open socket,
- be a socket that may be freed via