pub fn is_loopback(url: &Url) -> bool
Whether a URL’s host names the loopback interface.
That is any IPv4 or IPv6 loopback address (RFC 8252 §7.3) or the domain localhost (§8.3), compared without regard to case.
localhost