Enum Host
pub enum Host<S = String>
The host name of an URL.
Variants
-
Domain(S) A DNS domain name, as '.' dot-separated labels. Non-ASCII labels are encoded in punycode per IDNA if this is the host of a special URL, or percent encoded for non-special URLs. Hosts for non-special URLs are also called opaque hosts.
-
Ipv4(Ipv4Addr) An IPv4 address.
Url::host_strreturns the serialization of this address, as four decimal integers separated by.dots.-
Ipv6(Ipv6Addr) An IPv6 address.
Url::host_strreturns the serialization of that address between[and]brackets, in the format per RFC 5952 A Recommendation for IPv6 Address Text Representation: lowercase hexadecimal with maximal::compression.
Implementations
impl Host<&str>
fn to_owned(&self) -> Host<String>Return a copy of
selfthat owns an allocatedStringbut 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.
fn parse_opaque(input: &str) -> Result<Self, ParseError>
Trait Implementations
impl<'de, S> Deserialize<'de> for Host<S>
where
S: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where __D: Deserializer<'de>,
impl<S> Serialize for Host<S>
where
S: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where __S: Serializer,
impl<S, T> PartialEq<Host<T>> for Host<S>
where
S: PartialEq<T>,
fn eq(&self, other: &Host<T>) -> bool
impl<S: AsRef<str>> Display for Host<S>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S: Clone> Clone for Host<S>
fn clone(&self) -> Self
impl<S: Debug> Debug for Host<S>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S: Eq> Eq for Host<S>
impl<S: Hash> Hash for Host<S>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<S: Ord> Ord for Host<S>
fn cmp(&self, other: &Self) -> Ordering
impl<S: PartialOrd> PartialOrd for Host<S>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>