pub trait Host: Unpin + 'static {
    fn hostname(&self) -> &str;

    fn port(&self) -> Option<u16> { ... }
}
Expand description

An interface for types where host parts (hostname and port) can be derived.

The WHATWG URL Standard defines the terminology used for this trait and its methods.

+------------------------+
|          host          |
+-----------------+------+
|    hostname     | port |
|                 |      |
| sub.example.com : 8080 |
+-----------------+------+

Required Methods

Extract hostname.

Provided Methods

Extract optional port.

Implementations on Foreign Types

Implementors