Skip to main content

IpAddrExt

Trait IpAddrExt 

Source
pub trait IpAddrExt {
    // Required method
    fn is_private(&self) -> bool;
}
Expand description

Extension trait for IpAddr to provide is_private() method.

Required Methods§

Source

fn is_private(&self) -> bool

Returns true if this address is in a private range.

For IPv4, checks if the address is in a private network range. For IPv6, checks if the address is a unique local address (fc00::/7).

Implementations on Foreign Types§

Source§

impl IpAddrExt for IpAddr

Implementors§