|
1 | 1 | //! Networking primitives for TCP/UDP communication.
|
2 | 2 | //!
|
3 |
| -//! For OS-specific networking primitives like Unix domain sockets, refer to the [`async_std::os`] |
4 |
| -//! module. |
| 3 | +//! This module provides networking functionality for the Transmission Control and User |
| 4 | +//! Datagram Protocols, as well as types for IP and socket addresses. |
5 | 5 | //!
|
6 | 6 | //! This module is an async version of [`std::net`].
|
7 | 7 | //!
|
| 8 | +//! # Organization |
| 9 | +//! |
| 10 | +//! * [`TcpListener`] and [`TcpStream`] provide functionality for communication over TCP |
| 11 | +//! * [`UdpSocket`] provides functionality for communication over UDP |
| 12 | +//! * [`IpAddr`] represents IP addresses of either IPv4 or IPv6; [`Ipv4Addr`] and |
| 13 | +//! [`Ipv6Addr`] are respectively IPv4 and IPv6 addresses |
| 14 | +//! * [`SocketAddr`] represents socket addresses of either IPv4 or IPv6; [`SocketAddrV4`] |
| 15 | +//! and [`SocketAddrV6`] are respectively IPv4 and IPv6 socket addresses |
| 16 | +//! * [`ToSocketAddrs`] is a trait that used for generic address resolution when interacting |
| 17 | +//! with networking objects like [`TcpListener`], [`TcpStream`] or [`UdpSocket`] |
| 18 | +//! * Other types are return or parameter types for various methods in this module |
| 19 | +//! |
| 20 | +//! [`IpAddr`]: enum.IpAddr.html |
| 21 | +//! [`Ipv4Addr`]: struct.Ipv4Addr.html |
| 22 | +//! [`Ipv6Addr`]: struct.Ipv6Addr.html |
| 23 | +//! [`SocketAddr`]: enum.SocketAddr.html |
| 24 | +//! [`SocketAddrV4`]: struct.SocketAddrV4.html |
| 25 | +//! [`SocketAddrV6`]: struct.SocketAddrV6.html |
| 26 | +//! [`TcpListener`]: struct.TcpListener.html |
| 27 | +//! [`TcpStream`]: struct.TcpStream.html |
| 28 | +//! [`ToSocketAddrs`]: trait.ToSocketAddrs.html |
| 29 | +//! [`UdpSocket`]: struct.UdpSocket.html |
| 30 | +//! |
| 31 | +//! # Platform-specific extensions |
| 32 | +//! |
| 33 | +//! APIs such as Unix domain sockets are available on certain platforms only. You can find |
| 34 | +//! platform-specific extensions in the [`async_std::os`] module. |
| 35 | +//! |
8 | 36 | //! [`async_std::os`]: ../os/index.html
|
9 | 37 | //! [`std::net`]: https://doc.rust-lang.org/std/net/index.html
|
10 | 38 | //!
|
11 |
| -//! ## Examples |
| 39 | +//! # Examples |
12 | 40 | //!
|
13 | 41 | //! A simple UDP echo server:
|
14 | 42 | //!
|
|
0 commit comments