Update tokio-udp to use std-future (#1199)

This commit is contained in:
Yin Guanhao
2019-06-26 14:41:36 -04:00
committed by Lucio Franco
parent 0784dc2767
commit 6316aa1d0b
16 changed files with 347 additions and 605 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ default = [
"sync",
"tcp",
# "timer",
# "udp",
"udp",
# "uds",
]
@@ -55,7 +55,7 @@ rt-full = [
sync = ["tokio-sync"]
tcp = ["tokio-tcp"]
#timer = ["tokio-timer"]
#udp = ["tokio-udp"]
udp = ["tokio-udp"]
#uds = ["tokio-uds"]
[dependencies]
@@ -75,7 +75,7 @@ tokio-reactor = { version = "0.2.0", optional = true, path = "../tokio-reactor"
tokio-sync = { version = "0.2.0", optional = true, path = "../tokio-sync" }
#tokio-threadpool = { version = "0.2.0", optional = true, path = "../tokio-threadpool" }
tokio-tcp = { version = "0.2.0", optional = true, path = "../tokio-tcp" }
#tokio-udp = { version = "0.2.0", optional = true, path = "../tokio-udp" }
tokio-udp = { version = "0.2.0", optional = true, path = "../tokio-udp" }
#tokio-timer = { version = "0.3.0", optional = true, path = "../tokio-timer" }
#tokio-trace-core = { version = "0.2", optional = true }
+1
View File
@@ -102,4 +102,5 @@ if_runtime! {
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use tokio_macros::main;
pub use tokio_macros::test;
}
+8 -12
View File
@@ -6,7 +6,7 @@
//! # Organization
//!
//! * [`TcpListener`] and [`TcpStream`] provide functionality for communication over TCP
//! * [`UdpSocket`] and [`UdpFramed`] provide functionality for communication over UDP
//! * [`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
@@ -16,7 +16,6 @@
//! [`TcpListener`]: struct.TcpListener.html
//! [`TcpStream`]: struct.TcpStream.html
//! [`UdpSocket`]: struct.UdpSocket.html
//! [`UdpFramed`]: struct.UdpFramed.html
//! [`UnixListener`]: struct.UnixListener.html
//! [`UnixStream`]: struct.UnixStream.html
//! [`UnixDatagram`]: struct.UnixDatagram.html
@@ -52,20 +51,17 @@ pub mod udp {
//!
//! The main struct for UDP is the [`UdpSocket`], which represents a UDP socket.
//! Reading and writing to it can be done using futures, which return the
//! [`RecvDgram`] and [`SendDgram`] structs respectively.
//!
//! For convenience it's also possible to convert raw datagrams into higher-level
//! frames.
//! [`Recv`], [`Send`], [`RecvFrom`], [`SendTo`] structs respectively.
//!
//! [`UdpSocket`]: struct.UdpSocket.html
//! [`RecvDgram`]: struct.RecvDgram.html
//! [`SendDgram`]: struct.SendDgram.html
//! [`UdpFramed`]: struct.UdpFramed.html
//! [`framed`]: struct.UdpSocket.html#method.framed
pub use tokio_udp::{RecvDgram, SendDgram, UdpFramed, UdpSocket};
//! [`Recv`]: struct.Recv.html
//! [`Send`]: struct.Send.html
//! [`RecvFrom`]: struct.RecvFrom.html
//! [`SendTo`]: struct.SendTo.html
pub use tokio_udp::{UdpSocket, Recv, Send, RecvFrom, SendTo};
}
#[cfg(feature = "udp")]
pub use self::udp::{UdpFramed, UdpSocket};
pub use self::udp::UdpSocket;
#[cfg(all(unix, feature = "uds"))]
pub mod unix {