Skip to main content

AuthorityInputExt

Trait AuthorityInputExt 

pub trait AuthorityInputExt {
    // Required method
    fn authority(&self) -> Option<HostWithOptPort>;

    // Provided methods
    fn host(&self) -> Option<Host> { ... }
    fn host_as_domain(&self) -> Option<Domain> { ... }
    fn port(&self) -> Option<u16> { ... }
}
Available on crate feature net only.
Expand description

Read the routing authority (host[:port]) of a service input.

This is the HTTP routing authority — the :authority pseudo-header / Host header target — so it is a HostWithOptPort, not the RFC-3986 Authority type (userinfo is never used for routing). Returns None when no authority can be resolved.

Required Methods§

fn authority(&self) -> Option<HostWithOptPort>

The routing authority (host[:port]), or None if none is resolvable.

Provided Methods§

fn host(&self) -> Option<Host>

The authority Host, dropping any port.

fn host_as_domain(&self) -> Option<Domain>

The authority host as a Domain, or None if absent or not a domain (e.g. an IP literal).

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

The authority port, if one is set explicitly.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<T> AuthorityInputExt for &T

Implementors§

§

impl AuthorityInputExt for Parts

§

impl AuthorityInputExt for rama::tcp::client::Request

§

impl<Body> AuthorityInputExt for rama::http::Request<Body>