From 227533d456fe32e48ffcd3796f1e6c8f9318b230 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 25 Oct 2019 12:50:15 -0700 Subject: net: move into tokio crate (#1683) A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags. --- tokio/src/net/mod.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tokio/src/net/mod.rs (limited to 'tokio/src/net/mod.rs') diff --git a/tokio/src/net/mod.rs b/tokio/src/net/mod.rs new file mode 100644 index 00000000..2ebf773f --- /dev/null +++ b/tokio/src/net/mod.rs @@ -0,0 +1,47 @@ +//! TCP/UDP/Unix bindings for `tokio`. +//! +//! This module contains the TCP/UDP/Unix networking types, similar to the standard +//! library, which can be used to implement networking protocols. +//! +//! # Organization +//! +//! * [`TcpListener`] and [`TcpStream`] provide functionality for communication over TCP +//! * [`UdpSocket`] provides functionality for communication over UDP +//! * [`UnixListener`] and [`UnixStream`] provide functionality for communication over a +//! Unix Domain Stream Socket **(available on Unix only)** +//! * [`UnixDatagram`] and [`UnixDatagramFramed`] provide functionality for communication +//! over Unix Domain Datagram Socket **(available on Unix only)** + +//! +//! [`TcpListener`]: struct.TcpListener.html +//! [`TcpStream`]: struct.TcpStream.html +//! [`UdpSocket`]: struct.UdpSocket.html +//! [`UnixListener`]: struct.UnixListener.html +//! [`UnixStream`]: struct.UnixStream.html +//! [`UnixDatagram`]: struct.UnixDatagram.html +//! [`UnixDatagramFramed`]: struct.UnixDatagramFramed.html + +mod addr; +pub use addr::ToSocketAddrs; + +pub mod driver; + +pub mod util; + +#[cfg(feature = "tcp")] +pub mod tcp; + +#[cfg(feature = "tcp")] +pub use self::tcp::{TcpListener, TcpStream}; + +#[cfg(feature = "udp")] +pub mod udp; + +#[cfg(feature = "udp")] +pub use self::udp::UdpSocket; + +#[cfg(all(unix, feature = "uds"))] +pub mod unix; + +#[cfg(all(unix, feature = "uds"))] +pub use self::unix::{UnixDatagram, UnixListener, UnixStream}; -- cgit v1.2.3