@@ -319,7 +319,7 @@ impl Ipv4Addr {
319
319
Ipv4Addr { inner : c:: in_addr { s_addr : u32:: from_ne_bytes ( [ a, b, c, d] ) } }
320
320
}
321
321
322
- /// An IPv4 address with the address pointing to localhost: 127.0.0.1.
322
+ /// An IPv4 address with the address pointing to localhost: ` 127.0.0.1`
323
323
///
324
324
/// # Examples
325
325
///
@@ -332,7 +332,7 @@ impl Ipv4Addr {
332
332
#[ stable( feature = "ip_constructors" , since = "1.30.0" ) ]
333
333
pub const LOCALHOST : Self = Ipv4Addr :: new ( 127 , 0 , 0 , 1 ) ;
334
334
335
- /// An IPv4 address representing an unspecified address: 0.0.0.0
335
+ /// An IPv4 address representing an unspecified address: ` 0.0.0.0`
336
336
///
337
337
/// This corresponds to the constant `INADDR_ANY` in other languages.
338
338
///
@@ -348,7 +348,7 @@ impl Ipv4Addr {
348
348
#[ stable( feature = "ip_constructors" , since = "1.30.0" ) ]
349
349
pub const UNSPECIFIED : Self = Ipv4Addr :: new ( 0 , 0 , 0 , 0 ) ;
350
350
351
- /// An IPv4 address representing the broadcast address: 255.255.255.255
351
+ /// An IPv4 address representing the broadcast address: ` 255.255.255.255`
352
352
///
353
353
/// # Examples
354
354
///
@@ -379,7 +379,7 @@ impl Ipv4Addr {
379
379
self . inner . s_addr . to_ne_bytes ( )
380
380
}
381
381
382
- /// Returns [`true`] for the special 'unspecified' address (0.0.0.0).
382
+ /// Returns [`true`] for the special 'unspecified' address (` 0.0.0.0` ).
383
383
///
384
384
/// This property is defined in _UNIX Network Programming, Second Edition_,
385
385
/// W. Richard Stevens, p. 891; see also [ip7].
@@ -401,7 +401,7 @@ impl Ipv4Addr {
401
401
self . inner . s_addr == 0
402
402
}
403
403
404
- /// Returns [`true`] if this is a loopback address (127.0.0.0/8).
404
+ /// Returns [`true`] if this is a loopback address (` 127.0.0.0/8` ).
405
405
///
406
406
/// This property is defined by [IETF RFC 1122].
407
407
///
@@ -426,9 +426,9 @@ impl Ipv4Addr {
426
426
///
427
427
/// The private address ranges are defined in [IETF RFC 1918] and include:
428
428
///
429
- /// - 10.0.0.0/8
430
- /// - 172.16.0.0/12
431
- /// - 192.168.0.0/16
429
+ /// - ` 10.0.0.0/8`
430
+ /// - ` 172.16.0.0/12`
431
+ /// - ` 192.168.0.0/16`
432
432
///
433
433
/// [IETF RFC 1918]: https://tools.ietf.org/html/rfc1918
434
434
///
@@ -457,7 +457,7 @@ impl Ipv4Addr {
457
457
}
458
458
}
459
459
460
- /// Returns [`true`] if the address is link-local (169.254.0.0/16).
460
+ /// Returns [`true`] if the address is link-local (` 169.254.0.0/16` ).
461
461
///
462
462
/// This property is defined by [IETF RFC 3927].
463
463
///
@@ -490,7 +490,7 @@ impl Ipv4Addr {
490
490
/// - the broadcast address (see [`Ipv4Addr::is_broadcast()`])
491
491
/// - addresses used for documentation (see [`Ipv4Addr::is_documentation()`])
492
492
/// - the unspecified address (see [`Ipv4Addr::is_unspecified()`]), and the whole
493
- /// 0.0.0.0/8 block
493
+ /// ` 0.0.0.0/8` block
494
494
/// - addresses reserved for future protocols (see
495
495
/// [`Ipv4Addr::is_ietf_protocol_assignment()`], except
496
496
/// `192.0.0.9/32` and `192.0.0.10/32` which are globally routable
@@ -682,9 +682,9 @@ impl Ipv4Addr {
682
682
self . octets ( ) [ 0 ] & 240 == 240 && !self . is_broadcast ( )
683
683
}
684
684
685
- /// Returns [`true`] if this is a multicast address (224.0.0.0/4).
685
+ /// Returns [`true`] if this is a multicast address (` 224.0.0.0/4` ).
686
686
///
687
- /// Multicast addresses have a most significant octet between 224 and 239,
687
+ /// Multicast addresses have a most significant octet between ` 224` and ` 239` ,
688
688
/// and is defined by [IETF RFC 5771].
689
689
///
690
690
/// [IETF RFC 5771]: https://tools.ietf.org/html/rfc5771
@@ -705,9 +705,9 @@ impl Ipv4Addr {
705
705
self . octets ( ) [ 0 ] >= 224 && self . octets ( ) [ 0 ] <= 239
706
706
}
707
707
708
- /// Returns [`true`] if this is a broadcast address (255.255.255.255).
708
+ /// Returns [`true`] if this is a broadcast address (` 255.255.255.255` ).
709
709
///
710
- /// A broadcast address has all octets set to 255 as defined in [IETF RFC 919].
710
+ /// A broadcast address has all octets set to ` 255` as defined in [IETF RFC 919].
711
711
///
712
712
/// [IETF RFC 919]: https://tools.ietf.org/html/rfc919
713
713
///
@@ -730,9 +730,9 @@ impl Ipv4Addr {
730
730
///
731
731
/// This is defined in [IETF RFC 5737]:
732
732
///
733
- /// - 192.0.2.0/24 (TEST-NET-1)
734
- /// - 198.51.100.0/24 (TEST-NET-2)
735
- /// - 203.0.113.0/24 (TEST-NET-3)
733
+ /// - ` 192.0.2.0/24` (TEST-NET-1)
734
+ /// - ` 198.51.100.0/24` (TEST-NET-2)
735
+ /// - ` 203.0.113.0/24` (TEST-NET-3)
736
736
///
737
737
/// [IETF RFC 5737]: https://tools.ietf.org/html/rfc5737
738
738
///
@@ -760,7 +760,7 @@ impl Ipv4Addr {
760
760
761
761
/// Converts this address to an IPv4-compatible [`IPv6` address].
762
762
///
763
- /// a.b.c.d becomes ::a.b.c.d
763
+ /// ` a.b.c.d` becomes ` ::a.b.c.d`
764
764
///
765
765
/// This isn't typically the method you want; these addresses don't typically
766
766
/// function on modern systems. Use `to_ipv6_mapped` instead.
@@ -774,7 +774,7 @@ impl Ipv4Addr {
774
774
///
775
775
/// assert_eq!(
776
776
/// Ipv4Addr::new(192, 0, 2, 255).to_ipv6_compatible(),
777
- /// Ipv6Addr::new(0, 0, 0, 0, 0, 0, 49152, 767 )
777
+ /// Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0xc000, 0x2ff )
778
778
/// );
779
779
/// ```
780
780
#[ rustc_const_stable( feature = "const_ipv4" , since = "1.50.0" ) ]
@@ -789,7 +789,7 @@ impl Ipv4Addr {
789
789
790
790
/// Converts this address to an IPv4-mapped [`IPv6` address].
791
791
///
792
- /// a.b.c.d becomes ::ffff:a.b.c.d
792
+ /// ` a.b.c.d` becomes ` ::ffff:a.b.c.d`
793
793
///
794
794
/// [`IPv6` address]: Ipv6Addr
795
795
///
@@ -799,7 +799,7 @@ impl Ipv4Addr {
799
799
/// use std::net::{Ipv4Addr, Ipv6Addr};
800
800
///
801
801
/// assert_eq!(Ipv4Addr::new(192, 0, 2, 255).to_ipv6_mapped(),
802
- /// Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 49152, 767 ));
802
+ /// Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc000, 0x2ff ));
803
803
/// ```
804
804
#[ rustc_const_stable( feature = "const_ipv4" , since = "1.50.0" ) ]
805
805
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -1172,7 +1172,7 @@ impl Ipv6Addr {
1172
1172
]
1173
1173
}
1174
1174
1175
- /// Returns [`true`] for the special 'unspecified' address (:: ).
1175
+ /// Returns [`true`] for the special 'unspecified' address (`::` ).
1176
1176
///
1177
1177
/// This property is defined in [IETF RFC 4291].
1178
1178
///
@@ -1374,7 +1374,7 @@ impl Ipv6Addr {
1374
1374
( self . segments ( ) [ 0 ] & 0xffc0 ) == 0xfe80
1375
1375
}
1376
1376
1377
- /// Returns [`true`] if this is a deprecated unicast site-local address (fec0::/10). The
1377
+ /// Returns [`true`] if this is a deprecated unicast site-local address (` fec0::/10` ). The
1378
1378
/// unicast site-local address format is defined in [RFC 4291 section 2.5.7] as:
1379
1379
///
1380
1380
/// ```no_rust
@@ -1403,7 +1403,7 @@ impl Ipv6Addr {
1403
1403
///
1404
1404
/// # Warning
1405
1405
///
1406
- /// As per [RFC 3879], the whole `FEC0 ::/10` prefix is
1406
+ /// As per [RFC 3879], the whole `fec0 ::/10` prefix is
1407
1407
/// deprecated. New software must not support site-local
1408
1408
/// addresses.
1409
1409
///
@@ -1512,7 +1512,7 @@ impl Ipv6Addr {
1512
1512
}
1513
1513
}
1514
1514
1515
- /// Returns [`true`] if this is a multicast address (ff00::/8).
1515
+ /// Returns [`true`] if this is a multicast address (` ff00::/8` ).
1516
1516
///
1517
1517
/// This property is defined by [IETF RFC 4291].
1518
1518
///
@@ -1568,7 +1568,7 @@ impl Ipv6Addr {
1568
1568
/// Converts this address to an [`IPv4` address]. Returns [`None`] if this address is
1569
1569
/// neither IPv4-compatible or IPv4-mapped.
1570
1570
///
1571
- /// ::a.b.c.d and ::ffff:a.b.c.d become a.b.c.d
1571
+ /// ` ::a.b.c.d` and ` ::ffff:a.b.c.d` become ` a.b.c.d`
1572
1572
///
1573
1573
/// [`IPv4` address]: Ipv4Addr
1574
1574
///
0 commit comments