1 #![cfg(not(loom))]
2 
3 //! TCP/UDP/Unix bindings for `tokio`.
4 //!
5 //! This module contains the TCP/UDP/Unix networking types, similar to the standard
6 //! library, which can be used to implement networking protocols.
7 //!
8 //! # Organization
9 //!
10 //! * [`TcpListener`] and [`TcpStream`] provide functionality for communication over TCP
11 //! * [`UdpSocket`] provides functionality for communication over UDP
12 //! * [`UnixListener`] and [`UnixStream`] provide functionality for communication over a
13 //! Unix Domain Stream Socket **(available on Unix only)**
14 //! * [`UnixDatagram`] provides functionality for communication
15 //! over Unix Domain Datagram Socket **(available on Unix only)**
16 
17 //!
18 //! [`TcpListener`]: TcpListener
19 //! [`TcpStream`]: TcpStream
20 //! [`UdpSocket`]: UdpSocket
21 //! [`UnixListener`]: UnixListener
22 //! [`UnixStream`]: UnixStream
23 //! [`UnixDatagram`]: UnixDatagram
24 
25 mod addr;
26 #[cfg(feature = "net")]
27 pub(crate) use addr::to_socket_addrs;
28 pub use addr::ToSocketAddrs;
29 
30 cfg_net! {
31     mod lookup_host;
32     pub use lookup_host::lookup_host;
33 
34     pub mod tcp;
35     pub use tcp::listener::TcpListener;
36     pub use tcp::socket::TcpSocket;
37     pub use tcp::stream::TcpStream;
38 
39     mod udp;
40     pub use udp::UdpSocket;
41 }
42 
43 cfg_net_unix! {
44     pub mod unix;
45     pub use unix::datagram::socket::UnixDatagram;
46     pub use unix::listener::UnixListener;
47     pub use unix::stream::UnixStream;
48 }
49