about summary refs log tree commit diff
path: root/library/std/src/net
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2021-04-16 12:57:20 -0700
committerJosh Triplett <josh@joshtriplett.org>2021-04-16 13:18:04 -0700
commit9aa4d068a10ea03dffc349485456ae342667a142 (patch)
tree4426d6544809e8c89f7e5c0a8b7672fb50e63520 /library/std/src/net
parent0cc00c48d2c8f7344028cf007d1ee551b886b602 (diff)
Add documentation to help people find `Ipv4Addr::UNSPECIFIED`
People looking for `INADDR_ANY` don't always find
`Ipv4Addr::UNSPECIFIED`; add some documentation and an alias to help.
Diffstat (limited to 'library/std/src/net')
-rw-r--r--library/std/src/net/ip.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs
index da2415e3610..9b629e19be5 100644
--- a/library/std/src/net/ip.rs
+++ b/library/std/src/net/ip.rs
@@ -334,6 +334,8 @@ impl Ipv4Addr {
 
     /// An IPv4 address representing an unspecified address: 0.0.0.0
     ///
+    /// This corresponds to the constant `INADDR_ANY` in other languages.
+    ///
     /// # Examples
     ///
     /// ```
@@ -342,6 +344,7 @@ impl Ipv4Addr {
     /// let addr = Ipv4Addr::UNSPECIFIED;
     /// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
     /// ```
+    #[doc(alias = "INADDR_ANY")]
     #[stable(feature = "ip_constructors", since = "1.30.0")]
     pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);