about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-05-02 03:52:29 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-05-03 04:57:02 +0200
commitf86da3d6dee0bfde56c27a33bfe33d9e3c0b2c83 (patch)
tree2856fbb5afeb26c60d4128436b2f31367ace57fc /src/libstd/net
parent8a60e5667fa77c4a7a4e13bf7ab4ad6f1d033ca9 (diff)
downloadrust-f86da3d6dee0bfde56c27a33bfe33d9e3c0b2c83.tar.gz
rust-f86da3d6dee0bfde56c27a33bfe33d9e3c0b2c83.zip
doc: improve IpAddr is_global and is_unicast_global
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()