Skip to content

Commit 131ba57

Browse files
committed
IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT documentation.
Added documentation for IPv6 Addresses `IN6ADDR_ANY_INIT` also known as `in6addr_any` and `IN6ADDR_LOOPBACK_INIT` also known as `in6addr_loopback` similar to `INADDR_ANY` for IPv4 Addresses.
1 parent 8d36948 commit 131ba57

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/std/src/net/ip_addr.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,9 @@ impl Ipv6Addr {
11971197

11981198
/// An IPv6 address representing localhost: `::1`.
11991199
///
1200+
/// This corresponds to constant `IN6ADDR_LOOPBACK_INIT` or `in6addr_loopback` in other
1201+
/// languages.
1202+
///
12001203
/// # Examples
12011204
///
12021205
/// ```
@@ -1205,11 +1208,15 @@ impl Ipv6Addr {
12051208
/// let addr = Ipv6Addr::LOCALHOST;
12061209
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
12071210
/// ```
1211+
#[doc(alias = "IN6ADDR_LOOPBACK_INIT")]
1212+
#[doc(alias = "in6addr_loopback")]
12081213
#[stable(feature = "ip_constructors", since = "1.30.0")]
12091214
pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
12101215

12111216
/// An IPv6 address representing the unspecified address: `::`
12121217
///
1218+
/// This corresponds to constant `IN6ADDR_ANY_INIT` or `in6addr_any` in other languages.
1219+
///
12131220
/// # Examples
12141221
///
12151222
/// ```
@@ -1218,6 +1225,8 @@ impl Ipv6Addr {
12181225
/// let addr = Ipv6Addr::UNSPECIFIED;
12191226
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
12201227
/// ```
1228+
#[doc(alias = "IN6ADDR_ANY_INIT")]
1229+
#[doc(alias = "in6addr_any")]
12211230
#[stable(feature = "ip_constructors", since = "1.30.0")]
12221231
pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
12231232

0 commit comments

Comments
 (0)