Skip to content

Commit bd20fc1

Browse files
authored
Rollup merge of rust-lang#104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se
`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.
2 parents 25b1f1c + 131ba57 commit bd20fc1

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
@@ -1195,6 +1195,9 @@ impl Ipv6Addr {
11951195

11961196
/// An IPv6 address representing localhost: `::1`.
11971197
///
1198+
/// This corresponds to constant `IN6ADDR_LOOPBACK_INIT` or `in6addr_loopback` in other
1199+
/// languages.
1200+
///
11981201
/// # Examples
11991202
///
12001203
/// ```
@@ -1203,11 +1206,15 @@ impl Ipv6Addr {
12031206
/// let addr = Ipv6Addr::LOCALHOST;
12041207
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
12051208
/// ```
1209+
#[doc(alias = "IN6ADDR_LOOPBACK_INIT")]
1210+
#[doc(alias = "in6addr_loopback")]
12061211
#[stable(feature = "ip_constructors", since = "1.30.0")]
12071212
pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
12081213

12091214
/// An IPv6 address representing the unspecified address: `::`
12101215
///
1216+
/// This corresponds to constant `IN6ADDR_ANY_INIT` or `in6addr_any` in other languages.
1217+
///
12111218
/// # Examples
12121219
///
12131220
/// ```
@@ -1216,6 +1223,8 @@ impl Ipv6Addr {
12161223
/// let addr = Ipv6Addr::UNSPECIFIED;
12171224
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
12181225
/// ```
1226+
#[doc(alias = "IN6ADDR_ANY_INIT")]
1227+
#[doc(alias = "in6addr_any")]
12191228
#[stable(feature = "ip_constructors", since = "1.30.0")]
12201229
pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
12211230

0 commit comments

Comments
 (0)