forked from mirror/async-std
add some missing windows imports
This commit is contained in:
parent
228cc59b3b
commit
3161a4e449
3 changed files with 8 additions and 5 deletions
|
@ -229,7 +229,7 @@ cfg_unix! {
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg_windows! {
|
cfg_windows! {
|
||||||
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
|
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, AsRawSocket, RawSocket, FromRawSocket};
|
||||||
|
|
||||||
impl AsRawSocket for TcpListener {
|
impl AsRawSocket for TcpListener {
|
||||||
fn as_raw_socket(&self) -> RawSocket {
|
fn as_raw_socket(&self) -> RawSocket {
|
||||||
|
|
|
@ -388,7 +388,7 @@ cfg_unix! {
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg_windows! {
|
cfg_windows! {
|
||||||
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
|
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, RawSocket, AsRawSocket, FromRawSocket, IntoRawSocket};
|
||||||
|
|
||||||
impl AsRawSocket for TcpStream {
|
impl AsRawSocket for TcpStream {
|
||||||
fn as_raw_socket(&self) -> RawSocket {
|
fn as_raw_socket(&self) -> RawSocket {
|
||||||
|
@ -402,9 +402,12 @@ cfg_windows! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoRawSocket for TcpListener {
|
impl IntoRawSocket for crate::net::tcp::TcpListener {
|
||||||
fn into_raw_socket(self) -> RawSocket {
|
fn into_raw_socket(self) -> RawSocket {
|
||||||
self.raw_socket
|
// TODO(stjepang): This does not mean `RawFd` is now the sole owner of the file
|
||||||
|
// descriptor because it's possible that there are other clones of this `TcpStream`
|
||||||
|
// using it at the same time. We should probably document that behavior.
|
||||||
|
self.as_raw_socket()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -482,7 +482,7 @@ cfg_unix! {
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg_windows! {
|
cfg_windows! {
|
||||||
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle};
|
use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, RawSocket, AsRawSocket, IntoRawSocket, FromRawSocket};
|
||||||
|
|
||||||
impl AsRawSocket for UdpSocket {
|
impl AsRawSocket for UdpSocket {
|
||||||
fn as_raw_socket(&self) -> RawSocket {
|
fn as_raw_socket(&self) -> RawSocket {
|
||||||
|
|
Loading…
Reference in a new issue