pub fn classify_host(url: &Url) -> HostClassExpand description
Classifies url‘s host into a HostClass, from the URL alone — no DNS resolution
is performed (see the module docs’ residual-risk note).
§Examples
use deps_core::net_policy::{HostClass, classify_host};
use url::Url;
let url = Url::parse("https://169.254.169.254/latest/meta-data/").unwrap();
assert_eq!(classify_host(&url), HostClass::CloudMetadata);
let url = Url::parse("https://index.crates.io/").unwrap();
assert_eq!(classify_host(&url), HostClass::Global);