Trait p2p::IpAddrExt [−][src]
pub trait IpAddrExt { fn is_global(&self) -> bool; fn is_private(&self) -> bool; fn expand_local_unspecified(&self) -> Result<Vec<IpAddr>>; fn unspecified_to_localhost(&self) -> IpAddr; }
Some helpful additional methods for IpvAddr
.
Required Methods
fn is_global(&self) -> bool
Check whether an IP address is global.
fn is_private(&self) -> bool
Check whether an IP address belongs to a private subnet.
fn expand_local_unspecified(&self) -> Result<Vec<IpAddr>>
If the IP address is an unspecified address (eg. 0.0.0.0
), then it is expanded into a
vector with a seperate IP address for each network interface.
fn unspecified_to_localhost(&self) -> IpAddr
If this is the unspecified address then map it to the localhost address.
Implementations on Foreign Types
impl IpAddrExt for IpAddr
[src]
impl IpAddrExt for IpAddr
fn is_global(&self) -> bool
[src]
fn is_global(&self) -> bool
fn is_private(&self) -> bool
[src]
fn is_private(&self) -> bool
fn expand_local_unspecified(&self) -> Result<Vec<IpAddr>>
[src]
fn expand_local_unspecified(&self) -> Result<Vec<IpAddr>>
fn unspecified_to_localhost(&self) -> IpAddr
[src]
fn unspecified_to_localhost(&self) -> IpAddr