pub trait Host: Unpin + 'static {
// Required method
fn hostname(&self) -> &str;
// Provided method
fn port(&self) -> Option<u16> { ... }
}
Available on crate feature
connect
only.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 |
+-----------------+------+