pub fn get_hostname<S: Into<String>>(
    domain: S
) -> Result<String, RustgenpassError>
Expand description

Isolate the domain name of a URL with default config.

Arguments

  • domain - Domain / URL to get base hostname for

Examples

use rustgenpass::get_hostname;
let hostname = get_hostname("https://user:pass@www.example.com:4711/path/file.html");
assert_eq!("example.com", hostname.unwrap());