Document when types have OS-dependent sizes
As per issue #43601, types that can change size depending on the target operating system should say so in their documentation. I used this template when adding doc comments: The size of a(n) <name> struct may vary depending on the target operating system, and may change between Rust releases. For enums, I used "instance" instead of "struct".
This commit is contained in:
@@ -28,6 +28,9 @@ use slice;
|
||||
/// as possibly some version-dependent additional information. See [`SocketAddrV4`]'s and
|
||||
/// [`SocketAddrV6`]'s respective documentation for more details.
|
||||
///
|
||||
/// The size of a SocketAddr instance may vary depending on the target operating
|
||||
/// system, and may change between Rust releases.
|
||||
///
|
||||
/// [IP address]: ../../std/net/enum.IpAddr.html
|
||||
/// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
|
||||
/// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
|
||||
@@ -61,6 +64,9 @@ pub enum SocketAddr {
|
||||
///
|
||||
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
|
||||
///
|
||||
/// The size of a SocketAddrV4 struct may vary depending on the target operating
|
||||
/// system, and may change between Rust releases.
|
||||
///
|
||||
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
|
||||
/// [IPv4 address]: ../../std/net/struct.Ipv4Addr.html
|
||||
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
|
||||
@@ -88,6 +94,9 @@ pub struct SocketAddrV4 { inner: c::sockaddr_in }
|
||||
///
|
||||
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
|
||||
///
|
||||
/// The size of a SocketAddrV6 struct may vary depending on the target operating
|
||||
/// system, and may change between Rust releases.
|
||||
///
|
||||
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
|
||||
/// [IPv6 address]: ../../std/net/struct.Ipv6Addr.html
|
||||
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
|
||||
|
||||
Reference in New Issue
Block a user