1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#![doc(html_root_url = "https://docs.rs/tokio-tcp/0.1.1")]
#![deny(missing_docs, warnings, missing_debug_implementations)]
extern crate bytes;
#[macro_use]
extern crate futures;
extern crate iovec;
extern crate mio;
extern crate tokio_io;
extern crate tokio_reactor;
#[cfg(feature = "unstable-futures")]
extern crate futures2;
mod incoming;
mod listener;
mod stream;
pub use self::incoming::Incoming;
pub use self::listener::TcpListener;
pub use self::stream::TcpStream;
pub use self::stream::ConnectFuture;
#[cfg(feature = "unstable-futures")]
fn lift_async<T>(old: futures::Async<T>) -> futures2::Async<T> {
match old {
futures::Async::Ready(x) => futures2::Async::Ready(x),
futures::Async::NotReady => futures2::Async::Pending,
}
}
#[cfg(feature = "unstable-futures")]
fn lower_async<T>(new: futures2::Async<T>) -> futures::Async<T> {
match new {
futures2::Async::Ready(x) => futures::Async::Ready(x),
futures2::Async::Pending => futures::Async::NotReady,
}
}