actix_tls::connect

Trait Host

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

    // Provided method
    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§

source

fn hostname(&self) -> &str

Extract hostname.

Provided Methods§

source

fn port(&self) -> Option<u16>

Extract optional port.

Implementations on Foreign Types§

source§

impl Host for &'static str

source§

fn hostname(&self) -> &str

source§

fn port(&self) -> Option<u16>

source§

impl Host for String

source§

fn hostname(&self) -> &str

source§

fn port(&self) -> Option<u16>

source§

impl Host for Uri

source§

fn hostname(&self) -> &str

source§

fn port(&self) -> Option<u16>

source§

impl Host for Uri

source§

fn hostname(&self) -> &str

source§

fn port(&self) -> Option<u16>

Implementors§