Enum url::Host
[−]
[src]
pub enum Host<S = String> { Domain(S), Ipv4(Ipv4Addr), Ipv6(Ipv6Addr), }
The host name of an URL.
Variants
Domain | A DNS domain name, as '.' dot-separated labels. Non-ASCII labels are encoded in punycode per IDNA. | |
Ipv4 | An IPv4 address.
| |
Ipv6 | An IPv6 address.
|
Methods
impl<'a> Host<&'a str>
fn to_owned(&self) -> Host<String>
Return a copy of self
that owns an allocated String
but does not borrow an &Url
.
impl Host<String>
fn parse(input: &str) -> Result<Self, ParseError>
Parse a host: either an IPv6 address in [] square brackets, or a domain.