std::os::windows::io
On this page
- Traits
AsRawHandle1FromRawHandle1IntoRawHandle1AsRawSocket1FromRawSocket1IntoRawSocket1- Type aliases
raw handles and sockets.
File, the child pipes and the standard streams implement
AsRawHandle; the TCP and UDP sockets AsRawSocket. FromRaw*
takes ownership of a value and IntoRaw* gives it up. The values are
the full pointer-sized HANDLE and the SOCKET as Win32 gives them.
Traits
AsRawHandleSource
pub trait AsRawHandleThe HANDLE behind a handle, still owned by it
(INVALID_HANDLE_VALUE, -1, once the handle is closed).
The HANDLE, still owned by
self.
FromRawHandleSource
pub trait FromRawHandleA handle that owns HANDLE h from now on: closing the handle closes
h.
Safety:
hmust be an open kernel handle, and nothing else may close it.
IntoRawHandleSource
pub trait IntoRawHandleA handle that gives up its HANDLE: the handle is consumed and nothing closes the HANDLE; the caller owns it.
The HANDLE, now the caller's to close (
INVALID_HANDLE_VALUEifselfwas closed).
AsRawSocketSource
pub trait AsRawSocketThe SOCKET behind a socket, still owned by it (INVALID_SOCKET
once it is closed).
The SOCKET, still owned by
self.
FromRawSocketSource
pub trait FromRawSocketA socket that owns SOCKET s from now on: closing it closes s.
Safety:
smust be an open socket of the right kind, and nothing else may close it.
IntoRawSocketSource
pub trait IntoRawSocketA socket that gives up its SOCKET: the socket is consumed and nothing closes the SOCKET; the caller owns it.
The SOCKET, now the caller's to close (
INVALID_SOCKETifselfwas closed).
Type aliases
RawHandleSource
pub type RawHandle = isizeA Win32 HANDLE.
RawSocketSource
pub type RawSocket = u64A Winsock SOCKET.