Skip to content

Commit 11d0577

Browse files
authored
Merge pull request #396 from async-rs/net-docs
standardize net docs
2 parents 1175a37 + 20abd5c commit 11d0577

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

src/net/mod.rs

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
11
//! Networking primitives for TCP/UDP communication.
22
//!
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.
55
//!
66
//! This module is an async version of [`std::net`].
77
//!
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+
//!
836
//! [`async_std::os`]: ../os/index.html
937
//! [`std::net`]: https://doc.rust-lang.org/std/net/index.html
1038
//!
11-
//! ## Examples
39+
//! # Examples
1240
//!
1341
//! A simple UDP echo server:
1442
//!

0 commit comments

Comments
 (0)