Skip to main content

url_hostname

Function url_hostname 

Source
pub fn url_hostname(url: &Url) -> Option<&str>
Expand description

Get the hostname of a URL as a string.

API differences:

  • url crate: url.host_str() returns Option<&str>
  • ada-url crate: url.hostname() returns &str (empty string if no host)