diff options
author | Carl Lerche <me@carllerche.com> | 2019-11-25 14:32:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 14:32:55 -0800 |
commit | 4ddc4371709562d2bd1d0373f0555f7c31926e53 (patch) | |
tree | c34ef5906bf8ea7e7c732bd2c211795657e33455 /tokio/src/net/unix | |
parent | 3ecaa6d91cef271b4c079a2e28bc3270280bcee6 (diff) |
doc: add more doc_cfg annotations (#1821)
Also makes the `tokio::net::{tcp, udp, unix}` modules only for "utility"
types. The primary types are in `tokio::net` directly.
Diffstat (limited to 'tokio/src/net/unix')
-rw-r--r-- | tokio/src/net/unix/datagram.rs | 8 | ||||
-rw-r--r-- | tokio/src/net/unix/listener.rs | 8 | ||||
-rw-r--r-- | tokio/src/net/unix/mod.rs | 15 | ||||
-rw-r--r-- | tokio/src/net/unix/stream.rs | 16 |
4 files changed, 25 insertions, 22 deletions
diff --git a/tokio/src/net/unix/datagram.rs b/tokio/src/net/unix/datagram.rs index eb8bfe4c..ae1372f6 100644 --- a/tokio/src/net/unix/datagram.rs +++ b/tokio/src/net/unix/datagram.rs @@ -10,9 +10,11 @@ use std::os::unix::net::{self, SocketAddr}; use std::path::Path; use std::task::{Context, Poll}; -/// An I/O object representing a Unix datagram socket. -pub struct UnixDatagram { - io: PollEvented<mio_uds::UnixDatagram>, +cfg_uds! { + /// An I/O object representing a Unix datagram socket. + pub struct UnixDatagram { + io: PollEvented<mio_uds::UnixDatagram>, + } } impl UnixDatagram { diff --git a/tokio/src/net/unix/listener.rs b/tokio/src/net/unix/listener.rs index 7791b05f..5f4787ec 100644 --- a/tokio/src/net/unix/listener.rs +++ b/tokio/src/net/unix/listener.rs @@ -12,9 +12,11 @@ use std::os::unix::net::{self, SocketAddr}; use std::path::Path; use std::task::{Context, Poll}; -/// A Unix socket which can accept connections from other Unix sockets. -pub struct UnixListener { - io: PollEvented<mio_uds::UnixListener>, +cfg_uds! { + /// A Unix socket which can accept connections from other Unix sockets. + pub struct UnixListener { + io: PollEvented<mio_uds::UnixListener>, + } } impl UnixListener { diff --git a/tokio/src/net/unix/mod.rs b/tokio/src/net/unix/mod.rs index 1ec6fa8e..ddba60d1 100644 --- a/tokio/src/net/unix/mod.rs +++ b/tokio/src/net/unix/mod.rs @@ -1,21 +1,18 @@ -//! Unix Domain Sockets for Tokio. -//! -//! This crate provides APIs for using Unix Domain Sockets with Tokio. +//! Unix domain socket utility types -mod datagram; -pub use datagram::UnixDatagram; +pub(crate) mod datagram; mod incoming; pub use incoming::Incoming; -mod listener; -pub use listener::UnixListener; +pub(crate) mod listener; +pub(crate) use listener::UnixListener; mod split; pub use split::{ReadHalf, WriteHalf}; -mod stream; -pub use stream::UnixStream; +pub(crate) mod stream; +pub(crate) use stream::UnixStream; mod ucred; pub use ucred::UCred; diff --git a/tokio/src/net/unix/stream.rs b/tokio/src/net/unix/stream.rs index a430fa17..5151b08a 100644 --- a/tokio/src/net/unix/stream.rs +++ b/tokio/src/net/unix/stream.rs @@ -14,13 +14,15 @@ use std::path::Path; use std::pin::Pin; use std::task::{Context, Poll}; -/// A structure representing a connected Unix socket. -/// -/// This socket can be connected directly with `UnixStream::connect` or accepted -/// from a listener with `UnixListener::incoming`. Additionally, a pair of -/// anonymous Unix sockets can be created with `UnixStream::pair`. -pub struct UnixStream { - io: PollEvented<mio_uds::UnixStream>, +cfg_uds! { + /// A structure representing a connected Unix socket. + /// + /// This socket can be connected directly with `UnixStream::connect` or accepted + /// from a listener with `UnixListener::incoming`. Additionally, a pair of + /// anonymous Unix sockets can be created with `UnixStream::pair`. + pub struct UnixStream { + io: PollEvented<mio_uds::UnixStream>, + } } impl UnixStream { |