tokio_tcp/lib.rs
1#![doc(html_root_url = "https://docs.rs/tokio-tcp/0.1.3")]
2#![deny(missing_docs, missing_debug_implementations)]
3
4//! TCP bindings for `tokio`.
5//!
6//! > **Note:** This crate is **deprecated in tokio 0.2.x** and has been moved
7//! > into [`tokio::tcp`] behind the `tcp` [feature flag].
8//!
9//! [`tokio::tcp`]: https://docs.rs/tokio/latest/tokio/tcp/index.html
10//! [feature flag]: https://docs.rs/tokio/latest/tokio/index.html#feature-flags
11//!
12//! This module contains the TCP networking types, similar to the standard
13//! library, which can be used to implement networking protocols.
14//!
15//! Connecting to an address, via TCP, can be done using [`TcpStream`]'s
16//! [`connect`] method, which returns [`ConnectFuture`]. `ConnectFuture`
17//! implements a future which returns a `TcpStream`.
18//!
19//! To listen on an address [`TcpListener`] can be used. `TcpListener`'s
20//! [`incoming`][incoming_method] method can be used to accept new connections.
21//! It return the [`Incoming`] struct, which implements a stream which returns
22//! `TcpStream`s.
23//!
24//! [`TcpStream`]: struct.TcpStream.html
25//! [`connect`]: struct.TcpStream.html#method.connect
26//! [`ConnectFuture`]: struct.ConnectFuture.html
27//! [`TcpListener`]: struct.TcpListener.html
28//! [incoming_method]: struct.TcpListener.html#method.incoming
29//! [`Incoming`]: struct.Incoming.html
30
31extern crate bytes;
32#[macro_use]
33extern crate futures;
34extern crate iovec;
35extern crate mio;
36extern crate tokio_io;
37extern crate tokio_reactor;
38
39mod incoming;
40mod listener;
41mod stream;
42
43pub use self::incoming::Incoming;
44pub use self::listener::TcpListener;
45pub use self::stream::ConnectFuture;
46pub use self::stream::TcpStream;