Enum url::Host [] [src]

pub enum Host {
    Domain(String),
    Ipv4(Ipv4Addr),
    Ipv6(Ipv6Addr),
}

The host name of an URL.

Variants

A (DNS) domain name.

A IPv4 address, represented by four sequences of up to three ASCII digits.

An IPv6 address, represented inside [...] square brackets so that : colon characters in the address are not ambiguous with the port number delimiter.

Methods

impl Host
[src]

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

Returns Err for an empty host, an invalid IPv6 address, or a or invalid non-ASCII domain.

Serialize the host as a string.

A domain a returned as-is, an IPv6 address between [] square brackets.

Trait Implementations

impl PartialEq for Host
[src]

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

This method tests for !=.

impl Eq for Host
[src]

impl Clone for Host
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Host
[src]

Formats the value using the given formatter.

impl Hash for Host
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl PartialOrd for Host
[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 Ord for Host
[src]

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

impl Display for Host
[src]

Formats the value using the given formatter.