mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
30 lines
1.0 KiB
Rust
30 lines
1.0 KiB
Rust
//! TCP bindings for `tokio`.
|
|
//!
|
|
//! This module contains the TCP networking types, similar to the standard
|
|
//! library, which can be used to implement networking protocols.
|
|
//!
|
|
//! Connecting to an address, via TCP, can be done using [`TcpStream`]'s
|
|
//! [`connect`] method, which returns a future which returns a `TcpStream`.
|
|
//!
|
|
//! To listen on an address [`TcpListener`] can be used. `TcpListener`'s
|
|
//! [`incoming`][incoming_method] method can be used to accept new connections.
|
|
//! It return the [`Incoming`] struct, which implements a stream which returns
|
|
//! `TcpStream`s.
|
|
//!
|
|
//! [`TcpStream`]: struct.TcpStream.html
|
|
//! [`connect`]: struct.TcpStream.html#method.connect
|
|
//! [`TcpListener`]: struct.TcpListener.html
|
|
//! [incoming_method]: struct.TcpListener.html#method.incoming
|
|
//! [`Incoming`]: struct.Incoming.html
|
|
|
|
#[cfg(feature = "async-traits")]
|
|
mod incoming;
|
|
mod listener;
|
|
pub mod split;
|
|
mod stream;
|
|
|
|
#[cfg(feature = "async-traits")]
|
|
pub use self::incoming::Incoming;
|
|
pub use self::listener::TcpListener;
|
|
pub use self::stream::TcpStream;
|