Trait TargetHttpVersionInputExt
pub trait TargetHttpVersionInputExt {
// Required method
fn target_http_version(&self) -> Option<Version>;
// Provided method
fn target_http_version_with_fallback(
&self,
fallback: Option<Version>,
) -> Option<Version> { ... }
}Available on crate features
http and net only.Expand description
Read the target HTTP Version a connector should establish.
This is deliberately separate from HttpVersionInputExt, which may
resolve the original client version from forwarded request context. A
connector needs the selected egress version instead.
Required Methods§
fn target_http_version(&self) -> Option<Version>
fn target_http_version(&self) -> Option<Version>
The selected egress HTTP version, or None if none is available.
Provided Methods§
fn target_http_version_with_fallback(
&self,
fallback: Option<Version>,
) -> Option<Version>
fn target_http_version_with_fallback( &self, fallback: Option<Version>, ) -> Option<Version>
Resolve the selected egress HTTP version with a post-negotiation fallback.
Implementations that can distinguish an explicit target from an
implicit input version should override this method so fallback is
considered between those two sources.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".