summaryrefslogtreecommitdiffstats
path: root/tokio/src/net/udp
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-11-25 14:32:55 -0800
committerGitHub <noreply@github.com>2019-11-25 14:32:55 -0800
commit4ddc4371709562d2bd1d0373f0555f7c31926e53 (patch)
treec34ef5906bf8ea7e7c732bd2c211795657e33455 /tokio/src/net/udp
parent3ecaa6d91cef271b4c079a2e28bc3270280bcee6 (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/udp')
-rw-r--r--tokio/src/net/udp/mod.rs13
-rw-r--r--tokio/src/net/udp/socket.rs8
2 files changed, 8 insertions, 13 deletions
diff --git a/tokio/src/net/udp/mod.rs b/tokio/src/net/udp/mod.rs
index b4d3ea46..a616f4d5 100644
--- a/tokio/src/net/udp/mod.rs
+++ b/tokio/src/net/udp/mod.rs
@@ -1,14 +1,7 @@
-//! UDP bindings for `tokio`.
-//!
-//! This module contains the UDP networking types, similar to the standard
-//! library, which can be used to implement networking protocols.
-//!
-//! The main struct for UDP is the [`UdpSocket`], which represents a UDP socket.
-//!
-//! [`UdpSocket`]: struct.UdpSocket
+//! UDP utility types.
-mod socket;
-pub use socket::UdpSocket;
+pub(crate) mod socket;
+pub(crate) use socket::UdpSocket;
mod split;
pub use split::{RecvHalf, SendHalf, ReuniteError};
diff --git a/tokio/src/net/udp/socket.rs b/tokio/src/net/udp/socket.rs
index 30cc104e..c22ebd92 100644
--- a/tokio/src/net/udp/socket.rs
+++ b/tokio/src/net/udp/socket.rs
@@ -9,9 +9,11 @@ use std::io;
use std::net::{self, Ipv4Addr, Ipv6Addr, SocketAddr};
use std::task::{Context, Poll};
-/// An I/O object representing a UDP socket.
-pub struct UdpSocket {
- io: PollEvented<mio::net::UdpSocket>,
+cfg_udp! {
+ /// A UDP socket
+ pub struct UdpSocket {
+ io: PollEvented<mio::net::UdpSocket>,
+ }
}
impl UdpSocket {