@@ -1240,7 +1240,8 @@ impl Ipv6Addr {
12401240 match self . multicast_scope ( ) {
12411241 Some ( Ipv6MulticastScope :: Global ) => true ,
12421242 None => {
1243- self . is_unicast_global ( ) && !( self . is_unique_local ( ) || self . is_documentation ( ) )
1243+ self . has_unicast_global_scope ( )
1244+ && !( self . is_unique_local ( ) || self . is_documentation ( ) )
12441245 }
12451246 _ => false ,
12461247 }
@@ -1331,20 +1332,20 @@ impl Ipv6Addr {
13311332 /// use std::net::Ipv6Addr;
13321333 ///
13331334 /// // The loopback address (`::1`) does not actually have link-local scope.
1334- /// assert_eq!(Ipv6Addr::LOCALHOST.is_unicast_link_local (), false);
1335+ /// assert_eq!(Ipv6Addr::LOCALHOST.has_unicast_link_local_scope (), false);
13351336 ///
13361337 /// // Only addresses in `fe80::/10` have link-local scope.
1337- /// assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_unicast_link_local (), false);
1338- /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 0, 0, 0, 0, 0).is_unicast_link_local (), true);
1338+ /// assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).has_unicast_link_local_scope (), false);
1339+ /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 0, 0, 0, 0, 0).has_unicast_link_local_scope (), true);
13391340 ///
13401341 /// // Addresses outside the stricter `fe80::/64` also have link-local scope.
1341- /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 1, 0, 0, 0, 0).is_unicast_link_local (), true);
1342- /// assert_eq!(Ipv6Addr::new(0xfe81, 0, 0, 0, 0, 0, 0, 0).is_unicast_link_local (), true);
1342+ /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 1, 0, 0, 0, 0).has_unicast_link_local_scope (), true);
1343+ /// assert_eq!(Ipv6Addr::new(0xfe81, 0, 0, 0, 0, 0, 0, 0).has_unicast_link_local_scope (), true);
13431344 /// ```
13441345 #[ rustc_const_unstable( feature = "const_ipv6" , issue = "76205" ) ]
13451346 #[ unstable( feature = "ip" , issue = "27709" ) ]
13461347 #[ inline]
1347- pub const fn is_unicast_link_local ( & self ) -> bool {
1348+ pub const fn has_unicast_link_local_scope ( & self ) -> bool {
13481349 ( self . segments ( ) [ 0 ] & 0xffc0 ) == 0xfe80
13491350 }
13501351
@@ -1403,7 +1404,7 @@ impl Ipv6Addr {
14031404 /// [RFC 4291 section 2.5.7]: https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.7
14041405 /// [unspecified address]: Ipv6Addr::is_unspecified
14051406 /// [loopback address]: Ipv6Addr::is_loopback
1406- /// [link-local address]: Ipv6Addr::is_unicast_link_local
1407+ /// [link-local address]: Ipv6Addr::has_unicast_link_local_scope
14071408 ///
14081409 /// # Examples
14091410 ///
@@ -1413,33 +1414,33 @@ impl Ipv6Addr {
14131414 /// use std::net::Ipv6Addr;
14141415 ///
14151416 /// // The unspecified address (`::`) does not have unicast global scope
1416- /// assert_eq!(Ipv6Addr::UNSPECIFIED.is_unicast_global (), false);
1417+ /// assert_eq!(Ipv6Addr::UNSPECIFIED.has_unicast_global_scope (), false);
14171418 ///
14181419 /// // The loopback address (`::1`) does not have unicast global scope.
1419- /// assert_eq!(Ipv6Addr::LOCALHOST.is_unicast_global (), false);
1420+ /// assert_eq!(Ipv6Addr::LOCALHOST.has_unicast_global_scope (), false);
14201421 ///
14211422 /// // A unicast address with link-local scope (`fe80::/10`) does not have global scope.
1422- /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 0, 0, 0, 0, 0).is_unicast_global (), false);
1423+ /// assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 0, 0, 0, 0, 0).has_unicast_global_scope (), false);
14231424 ///
14241425 /// // A unicast address that had the deprecated site-local scope (`fec0::/10`) now has global scope.
1425- /// assert_eq!(Ipv6Addr::new(0xfec2, 0, 0, 0, 0, 0, 0, 0).is_unicast_global (), true);
1426+ /// assert_eq!(Ipv6Addr::new(0xfec2, 0, 0, 0, 0, 0, 0, 0).has_unicast_global_scope (), true);
14261427 ///
14271428 /// // Any multicast address (`ff00::/8`) does not have unicast global scope;
14281429 /// // there is a difference between unicast global scope and multicast global scope.
1429- /// assert_eq!(Ipv6Addr::new(0xff03, 0, 0, 0, 0, 0, 0, 0).is_unicast_global (), false);
1430- /// assert_eq!(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0).is_unicast_global (), false);
1430+ /// assert_eq!(Ipv6Addr::new(0xff03, 0, 0, 0, 0, 0, 0, 0).has_unicast_global_scope (), false);
1431+ /// assert_eq!(Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0).has_unicast_global_scope (), false);
14311432 ///
14321433 /// // Any other address is defined as having unicast global scope.
1433- /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unicast_global (), true);
1434+ /// assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).has_unicast_global_scope (), true);
14341435 /// ```
14351436 #[ rustc_const_unstable( feature = "const_ipv6" , issue = "76205" ) ]
14361437 #[ unstable( feature = "ip" , issue = "27709" ) ]
14371438 #[ inline]
1438- pub const fn is_unicast_global ( & self ) -> bool {
1439+ pub const fn has_unicast_global_scope ( & self ) -> bool {
14391440 self . is_unicast ( )
14401441 && !self . is_unspecified ( )
14411442 && !self . is_loopback ( )
1442- && !self . is_unicast_link_local ( )
1443+ && !self . has_unicast_link_local_scope ( )
14431444 }
14441445
14451446 /// Returns the address's multicast scope if the address is multicast.
0 commit comments