Skip to content

Commit 5aea184

Browse files
committed
std::net: improve Ipv6Addr::is_unicast_site_local() doc
- quote the RFC - add a link to the RFC - fix markdown
1 parent 02d815f commit 5aea184

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/libstd/net/ip.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,10 +1051,19 @@ impl Ipv6Addr {
10511051
(self.segments()[0] & 0xffc0) == 0xfe80
10521052
}
10531053

1054-
/// Returns [`true`] if this is a deprecated unicast site-local address
1055-
/// (fec0::/10).
1054+
/// Returns [`true`] if this is a deprecated unicast site-local address (fec0::/10). The
1055+
/// unicast site-local address format is defined in [RFC 4291 section 2.5.7] as:
1056+
///
1057+
/// ```no_rust
1058+
/// | 10 |
1059+
/// | bits | 54 bits | 64 bits |
1060+
/// +----------+-------------------------+----------------------------+
1061+
/// |1111111011| subnet ID | interface ID |
1062+
/// +----------+-------------------------+----------------------------+
1063+
/// ```
10561064
///
10571065
/// [`true`]: ../../std/primitive.bool.html
1066+
/// [RFC 4291 section 2.5.7]: https://tools.ietf.org/html/rfc4291#section-2.5.7
10581067
///
10591068
/// # Examples
10601069
///

0 commit comments

Comments
 (0)