# Trait std::os::windows::io::AsRawSocket

1.0.0 · source ·

    pub trait AsRawSocket {
        // Required method
        fn as_raw_socket(&self) -> RawSocket;
    }

Available on Windows only.
Expand description

Extracts raw sockets.

## Required Methods§

source

#### fn as_raw_socket(&self) -> RawSocket

Extracts the raw socket.

This function is typically used to borrow an owned socket. When used in this way, this method does not pass ownership of the raw socket to the caller, and the socket is only guaranteed to be valid while the original object has not yet been destroyed.

However, borrowing is not strictly required. See `AsSocket::as_socket` for an API which strictly borrows a socket.

## Implementors§

source§

### impl AsRawSocket for TcpListener

source§

### impl AsRawSocket for TcpStream

source§

### impl AsRawSocket for UdpSocket

1.63.0 · source§

### impl AsRawSocket for BorrowedSocket<'_>

1.63.0 · source§

### impl AsRawSocket for OwnedSocket