Module input_ext
net only.Expand description
Small, single-concern accessor traits for reading routing/transport properties off a service input (an http request, a connect target, …).
Each concern (URI, path, authority, protocol, http version, transport) is its own small trait, so a caller reads exactly the piece it needs instead of building a combined context up front.
Design (matching ClientIp): each resolution trait has
no ExtensionsRef bound and is never
blanket-derived from another trait — every input type opts in with the
resolution that fits it (the http Request/Parts impls in rama-http-types
walk the uri → TLS SNI → Forwarded → Host fallback chain;
a transport target resolves its authority directly). The only blanket impls
are the trivial reference-forwarding ones and the composed
ConnectorTargetInputExt, whose method is purely derived.
The return type is the fallibility contract: an Option may be absent (a
caller that requires it does .ok_or_else(|| …)? with its own error);
transport_protocol is
always known, so it returns a bare value.
Each resolution trait also carries default methods built on its one
required accessor (e.g. AuthorityInputExt::host_as_domain), so callers
get ergonomic projections without re-writing the same closure chains.
Traits§
- Authority
Input Ext - Read the routing authority (
host[:port]) of a service input. - Connector
Target Input Ext std - Resolve the transport address (
host:port) to connect to: the routingauthoritywith the applicationprotocol’s default port as the port fallback. - Http
Version Input Ext http - Read the negotiated HTTP
Versionof a service input. - Path
Input Ext - Read the URI path of a service input.
- Protocol
Input Ext - Read the application-layer
Protocol(scheme) of a service input. - Transport
Protocol Input Ext - Read the transport-layer
TransportProtocol(TCP/UDP) of a service input. - UriInput
Ext - Read the
Uriof a service input that carries one.