Skip to content

Commit f30dd2f

Browse files
committed
AsRawSocket, not AsRawHandle
1 parent f8ccb82 commit f30dd2f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/priv_io.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use unix_socket::UnixStream;
77
#[cfg(unix)]
88
use std::os::unix::io::{AsRawFd, RawFd};
99
#[cfg(windows)]
10-
use std::os::windows::io::{AsRawHandle, RawHandle};
10+
use std::os::windows::io::{AsRawSocket, RawSocket};
1111

1212
use {SslMode, ConnectError, ConnectParams, ConnectTarget};
1313
use io::{NegotiateSsl, StreamWrapper};
@@ -19,7 +19,7 @@ const DEFAULT_PORT: u16 = 5432;
1919
/// A connection to the Postgres server.
2020
///
2121
/// It implements `Read`, `Write` and `StreamWrapper`, as well as `AsRawFd` on
22-
/// Unix platforms and `AsRawHandle` on Windows platforms.
22+
/// Unix platforms and `AsRawSocket` on Windows platforms.
2323
pub struct Stream(InternalStream);
2424

2525
impl Read for Stream {
@@ -60,11 +60,11 @@ impl AsRawFd for Stream {
6060
}
6161

6262
#[cfg(windows)]
63-
impl AsRawHandle for Stream {
64-
fn as_raw_handle(&self) -> RawHandle {
63+
impl AsRawSocket for Stream {
64+
fn as_raw_socket(&self) -> RawSocket {
6565
// Unix sockets aren't supported on windows, so no need to match
6666
match self.0 {
67-
InternalStream::Tcp(ref s) => s.as_raw_handle(),
67+
InternalStream::Tcp(ref s) => s.as_raw_socket(),
6868
}
6969
}
7070
}

0 commit comments

Comments
 (0)