1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::views::{FilelikeViewType, SocketlikeViewType};
#[cfg(any(unix, target_os = "wasi"))]
use crate::OwnedFd;
#[cfg(windows)]
use crate::{OwnedHandle, OwnedSocket};

#[cfg(any(unix, target_os = "wasi"))]
unsafe impl FilelikeViewType for OwnedFd {}

#[cfg(windows)]
unsafe impl FilelikeViewType for OwnedHandle {}

#[cfg(windows)]
unsafe impl SocketlikeViewType for OwnedSocket {}

unsafe impl FilelikeViewType for std::fs::File {}

unsafe impl SocketlikeViewType for std::net::TcpStream {}

unsafe impl SocketlikeViewType for std::net::TcpListener {}

unsafe impl SocketlikeViewType for std::net::UdpSocket {}

#[cfg(unix)]
unsafe impl SocketlikeViewType for std::os::unix::net::UnixStream {}

#[cfg(unix)]
unsafe impl SocketlikeViewType for std::os::unix::net::UnixListener {}

#[cfg(unix)]
unsafe impl SocketlikeViewType for std::os::unix::net::UnixDatagram {}