Rollup merge of #84257 - joshtriplett:inaddr-any, r=m-ou-se
Add documentation to help people find `Ipv4Addr::UNSPECIFIED` People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`; add some documentation to help.
This commit is contained in:
commit
a3277e2a0a
@ -334,6 +334,8 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
|
||||
|
||||
/// An IPv4 address representing an unspecified address: 0.0.0.0
|
||||
///
|
||||
/// This corresponds to the constant `INADDR_ANY` in other languages.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
@ -342,6 +344,7 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
|
||||
/// let addr = Ipv4Addr::UNSPECIFIED;
|
||||
/// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
|
||||
/// ```
|
||||
#[doc(alias = "INADDR_ANY")]
|
||||
#[stable(feature = "ip_constructors", since = "1.30.0")]
|
||||
pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user