Skip to content

standardize net docs #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions src/net/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
//! Networking primitives for TCP/UDP communication.
//!
//! For OS-specific networking primitives like Unix domain sockets, refer to the [`async_std::os`]
//! module.
//! This module provides networking functionality for the Transmission Control and User
//! Datagram Protocols, as well as types for IP and socket addresses.
//!
//! This module is an async version of [`std::net`].
//!
//! # Organization
//!
//! * [`TcpListener`] and [`TcpStream`] provide functionality for communication over TCP
//! * [`UdpSocket`] provides functionality for communication over UDP
//! * [`IpAddr`] represents IP addresses of either IPv4 or IPv6; [`Ipv4Addr`] and
//! [`Ipv6Addr`] are respectively IPv4 and IPv6 addresses
//! * [`SocketAddr`] represents socket addresses of either IPv4 or IPv6; [`SocketAddrV4`]
//! and [`SocketAddrV6`] are respectively IPv4 and IPv6 socket addresses
//! * [`ToSocketAddrs`] is a trait that used for generic address resolution when interacting
//! with networking objects like [`TcpListener`], [`TcpStream`] or [`UdpSocket`]
//! * Other types are return or parameter types for various methods in this module
//!
//! [`IpAddr`]: enum.IpAddr.html
//! [`Ipv4Addr`]: struct.Ipv4Addr.html
//! [`Ipv6Addr`]: struct.Ipv6Addr.html
//! [`SocketAddr`]: enum.SocketAddr.html
//! [`SocketAddrV4`]: struct.SocketAddrV4.html
//! [`SocketAddrV6`]: struct.SocketAddrV6.html
//! [`TcpListener`]: struct.TcpListener.html
//! [`TcpStream`]: struct.TcpStream.html
//! [`ToSocketAddrs`]: trait.ToSocketAddrs.html
//! [`UdpSocket`]: struct.UdpSocket.html
//!
//! # Platform-specific extensions
//!
//! APIs such as Unix domain sockets are available on certain platforms only. You can find
//! platform-specific extensions in the [`async_std::os`] module.
//!
//! [`async_std::os`]: ../os/index.html
//! [`std::net`]: https://doc.rust-lang.org/std/net/index.html
//!
//! ## Examples
//! # Examples
//!
//! A simple UDP echo server:
//!
Expand Down