Trait ConnectorTargetInputExt
pub trait ConnectorTargetInputExt:
AuthorityInputExt
+ ProtocolInputExt
+ ExtensionsRef
+ Sealed {
// Provided methods
fn connector_target(&self) -> Option<HostWithPort> { ... }
fn connector_target_with_default_port(
&self,
default_port: u16,
) -> Option<HostWithPort> { ... }
}net only.Expand description
Resolve the transport address (host:port) to connect to: the routing
authority with the application
protocol’s default port as the port fallback.
Auto-implemented (and sealed) for every input that is both an
AuthorityInputExt and a ProtocolInputExt; it yields the typed
host:port a connector needs, and is never implemented by hand.
Provided Methods§
fn connector_target(&self) -> Option<HostWithPort>
fn connector_target(&self) -> Option<HostWithPort>
The host:port to connect to: the authority’s port if set, else the
protocol’s default port. None when no host (or no port) resolves.
NOTE that this method respects the extension ConnectorTarget
as overwrite, used for proxy connections and similar bypasses.
fn connector_target_with_default_port(
&self,
default_port: u16,
) -> Option<HostWithPort>
fn connector_target_with_default_port( &self, default_port: u16, ) -> Option<HostWithPort>
Like connector_target but with default_port as
the ultimate fallback (ConnectorTarget → authority port → protocol default → default_port),
so it yields Some whenever an authority resolves at all.
NOTE that this method respects the extension ConnectorTarget
as overwrite, used for proxy connections and similar bypasses.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".