[][src]Enum url::Host

pub enum Host<S = String> {
    Domain(S),
    Ipv4(Ipv4Addr),
    Ipv6(Ipv6Addr),
}
[]

The host name of an URL.

Variants

[]

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.

[]

An IPv4 address. Url::host_str returns the serialization of this address, as four decimal integers separated by . dots.

[]

An IPv6 address. Url::host_str returns 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.

Methods

impl<'a> Host<&'a str>
[src]
[]

[]

Return a copy of self that owns an allocated String but does not borrow an &Url.

impl Host<String>
[src]
[]

[]

Parse a host: either an IPv6 address in [] square brackets, or a domain.

https://url.spec.whatwg.org/#host-parsing

Trait Implementations

impl<S: PartialOrd> PartialOrd<Host<S>> for Host<S>
[src]
[+]

[]

This method returns an ordering between self and other values if one exists. Read more

[]

This method tests less than (for self and other) and is used by the < operator. Read more

[]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[]

This method tests greater than (for self and other) and is used by the > operator. Read more

[]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<S: Ord> Ord for Host<S>
[src]
[+]

[]

This method returns an Ordering between self and other. Read more

[]

Compares and returns the maximum of two values. Read more

[]

Compares and returns the minimum of two values. Read more

impl<S: PartialEq> PartialEq<Host<S>> for Host<S>
[src]
[+]

[]

This method tests for self and other values to be equal, and is used by ==. Read more

[]

This method tests for !=.

impl<S: Clone> Clone for Host<S>
[src]
[+]

[]

Returns a copy of the value. Read more

[]

Performs copy-assignment from source. Read more

impl<S: Eq> Eq for Host<S>
[src]

impl<S: Hash> Hash for Host<S>
[src]
[+]

[]

Feeds this value into the given [Hasher]. Read more

[]

Feeds a slice of this type into the given [Hasher]. Read more

impl<S: Debug> Debug for Host<S>
[src]
[+]

[]

Formats the value using the given formatter. Read more

impl<S: AsRef<str>> Display for Host<S>
[src]
[+]

[]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<S> Send for Host<S> where
    S: Send

impl<S> Sync for Host<S> where
    S: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]
[]

[]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]
[]

[]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]
[]

[]

Creates owned data from borrowed data, usually by cloning. Read more

[]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]
[]

[]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]
[]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

[]

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]
[]

[]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]
[]

[]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]
[]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

[]

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]
[]

[]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more