about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-04 02:19:09 +0000
committerbors <bors@rust-lang.org>2015-05-04 02:19:09 +0000
commit45b9a34a7b0ad3ccf85cd8f5a92cfe2e01861e69 (patch)
tree8530704fa050c64a680ca6f6de6193ca3268129b /src/libstd/net
parentce1150b9f02b6433955e9998f5a4099127edc362 (diff)
parentf86da3d6dee0bfde56c27a33bfe33d9e3c0b2c83 (diff)
downloadrust-45b9a34a7b0ad3ccf85cd8f5a92cfe2e01861e69.tar.gz
rust-45b9a34a7b0ad3ccf85cd8f5a92cfe2e01861e69.zip
Auto merge of #25044 - tshepang:doc-addr, r=alexcrichton
Diffstat (limited to 'src/libstd/net')
-rw-r--r--src/libstd/net/ip.rs28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index 9fd69840f7f..bd0408b21d2 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -113,10 +113,13 @@ impl Ipv4Addr {
 
     /// Returns true if the address appears to be globally routable.
     ///
-    /// Non-globally-routable networks include the private networks (10.0.0.0/8,
-    /// 172.16.0.0/12 and 192.168.0.0/16), the loopback network (127.0.0.0/8),
-    /// the link-local network (169.254.0.0/16), the broadcast address (255.255.255.255/32) and
-    /// the test networks used for documentation (192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24).
+    /// The following return false:
+    ///
+    /// - private address (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16)
+    /// - the loopback address (127.0.0.0/8)
+    /// - the link-local address (169.254.0.0/16)
+    /// - the broadcast address (255.255.255.255/32)
+    /// - test addresses used for documentation (192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24)
     pub fn is_global(&self) -> bool {
         !self.is_private() && !self.is_loopback() && !self.is_link_local() &&
         !self.is_broadcast() && !self.is_documentation()
@@ -284,9 +287,11 @@ impl Ipv6Addr {
 
     /// Returns true if the address appears to be globally routable.
     ///
-    /// Non-globally-routable networks include the loopback address; the
-    /// link-local, site-local, and unique local unicast addresses; and the
-    /// interface-, link-, realm-, admin- and site-local multicast addresses.
+    /// The following return false:
+    ///
+    /// - the loopback address
+    /// - link-local, site-local, and unique local unicast addresses
+    /// - interface-, link-, realm-, admin- and site-local multicast addresses
     pub fn is_global(&self) -> bool {
         match self.multicast_scope() {
             Some(Ipv6MulticastScope::Global) => true,
@@ -315,9 +320,12 @@ impl Ipv6Addr {
 
     /// Returns true if the address is a globally routable unicast address.
     ///
-    /// Non-globally-routable unicast addresses include the loopback address,
-    /// the link-local addresses, the deprecated site-local addresses and the
-    /// unique local addresses.
+    /// The following return false:
+    ///
+    /// - the loopback address
+    /// - the link-local addresses
+    /// - the (deprecated) site-local addresses
+    /// - unique local addresses
     pub fn is_unicast_global(&self) -> bool {
         !self.is_multicast()
             && !self.is_loopback() && !self.is_unicast_link_local()