@@ -314,7 +314,7 @@ impl Ipv4Addr {
314
314
Ipv4Addr { inner : c:: in_addr { s_addr : u32:: from_ne_bytes ( [ a, b, c, d] ) } }
315
315
}
316
316
317
- /// An IPv4 address with the address pointing to localhost: 127.0.0.1.
317
+ /// An IPv4 address with the address pointing to localhost: ` 127.0.0.1`
318
318
///
319
319
/// # Examples
320
320
///
@@ -327,7 +327,7 @@ impl Ipv4Addr {
327
327
#[ stable( feature = "ip_constructors" , since = "1.30.0" ) ]
328
328
pub const LOCALHOST : Self = Ipv4Addr :: new ( 127 , 0 , 0 , 1 ) ;
329
329
330
- /// An IPv4 address representing an unspecified address: 0.0.0.0
330
+ /// An IPv4 address representing an unspecified address: ` 0.0.0.0`
331
331
///
332
332
/// This corresponds to the constant `INADDR_ANY` in other languages.
333
333
///
@@ -343,7 +343,7 @@ impl Ipv4Addr {
343
343
#[ stable( feature = "ip_constructors" , since = "1.30.0" ) ]
344
344
pub const UNSPECIFIED : Self = Ipv4Addr :: new ( 0 , 0 , 0 , 0 ) ;
345
345
346
- /// An IPv4 address representing the broadcast address: 255.255.255.255
346
+ /// An IPv4 address representing the broadcast address: ` 255.255.255.255`
347
347
///
348
348
/// # Examples
349
349
///
@@ -374,7 +374,7 @@ impl Ipv4Addr {
374
374
self . inner . s_addr . to_ne_bytes ( )
375
375
}
376
376
377
- /// Returns [`true`] for the special 'unspecified' address (0.0.0.0).
377
+ /// Returns [`true`] for the special 'unspecified' address (` 0.0.0.0` ).
378
378
///
379
379
/// This property is defined in _UNIX Network Programming, Second Edition_,
380
380
/// W. Richard Stevens, p. 891; see also [ip7].
@@ -396,7 +396,7 @@ impl Ipv4Addr {
396
396
self . inner . s_addr == 0
397
397
}
398
398
399
- /// Returns [`true`] if this is a loopback address (127.0.0.0/8).
399
+ /// Returns [`true`] if this is a loopback address (` 127.0.0.0/8` ).
400
400
///
401
401
/// This property is defined by [IETF RFC 1122].
402
402
///
@@ -421,9 +421,9 @@ impl Ipv4Addr {
421
421
///
422
422
/// The private address ranges are defined in [IETF RFC 1918] and include:
423
423
///
424
- /// - 10.0.0.0/8
425
- /// - 172.16.0.0/12
426
- /// - 192.168.0.0/16
424
+ /// - ` 10.0.0.0/8`
425
+ /// - ` 172.16.0.0/12`
426
+ /// - ` 192.168.0.0/16`
427
427
///
428
428
/// [IETF RFC 1918]: https://tools.ietf.org/html/rfc1918
429
429
///
@@ -452,7 +452,7 @@ impl Ipv4Addr {
452
452
}
453
453
}
454
454
455
- /// Returns [`true`] if the address is link-local (169.254.0.0/16).
455
+ /// Returns [`true`] if the address is link-local (` 169.254.0.0/16` ).
456
456
///
457
457
/// This property is defined by [IETF RFC 3927].
458
458
///
@@ -485,7 +485,7 @@ impl Ipv4Addr {
485
485
/// - the broadcast address (see [`Ipv4Addr::is_broadcast()`])
486
486
/// - addresses used for documentation (see [`Ipv4Addr::is_documentation()`])
487
487
/// - the unspecified address (see [`Ipv4Addr::is_unspecified()`]), and the whole
488
- /// 0.0.0.0/8 block
488
+ /// ` 0.0.0.0/8` block
489
489
/// - addresses reserved for future protocols (see
490
490
/// [`Ipv4Addr::is_ietf_protocol_assignment()`], except
491
491
/// `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
///
@@ -1318,7 +1318,7 @@ impl Ipv6Addr {
1318
1318
( self . segments ( ) [ 0 ] & 0xffc0 ) == 0xfe80
1319
1319
}
1320
1320
1321
- /// Returns [`true`] if this is a deprecated unicast site-local address (fec0::/10). The
1321
+ /// Returns [`true`] if this is a deprecated unicast site-local address (` fec0::/10` ). The
1322
1322
/// unicast site-local address format is defined in [RFC 4291 section 2.5.7] as:
1323
1323
///
1324
1324
/// ```no_rust
@@ -1347,7 +1347,7 @@ impl Ipv6Addr {
1347
1347
///
1348
1348
/// # Warning
1349
1349
///
1350
- /// As per [RFC 3879], the whole `FEC0 ::/10` prefix is
1350
+ /// As per [RFC 3879], the whole `fec0 ::/10` prefix is
1351
1351
/// deprecated. New software must not support site-local
1352
1352
/// addresses.
1353
1353
///
@@ -1460,7 +1460,7 @@ impl Ipv6Addr {
1460
1460
}
1461
1461
}
1462
1462
1463
- /// Returns [`true`] if this is a multicast address (ff00::/8).
1463
+ /// Returns [`true`] if this is a multicast address (` ff00::/8` ).
1464
1464
///
1465
1465
/// This property is defined by [IETF RFC 4291].
1466
1466
///
@@ -1517,7 +1517,7 @@ impl Ipv6Addr {
1517
1517
/// Converts this address to an [`IPv4` address]. Returns [`None`] if this address is
1518
1518
/// neither IPv4-compatible or IPv4-mapped.
1519
1519
///
1520
- /// ::a.b.c.d and ::ffff:a.b.c.d become a.b.c.d
1520
+ /// ` ::a.b.c.d` and ` ::ffff:a.b.c.d` become ` a.b.c.d`
1521
1521
///
1522
1522
/// [`IPv4` address]: Ipv4Addr
1523
1523
///
0 commit comments