Function brane_shr::utilities::is_ip_addr

source ·
pub fn is_ip_addr(address: impl AsRef<str>) -> bool
Expand description

Returns whether the given address is an IP address or not.

The address can already involve paths or an HTTP schema. In that case, only the ‘host’ part is checked.

Both IPv4 and IPv6 addresses are matched.

§Arguments

  • address: The address to check.

§Returns

true if the address is an IP-address, or false otherwise.