Skip to main content

TargetHttpVersionInputExt

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 feature 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>

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>

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".

Implementations on Foreign Types§

§

impl<T> TargetHttpVersionInputExt for &T

Available on crate feature http only.

Implementors§

§

impl TargetHttpVersionInputExt for ConnectRequest

Available on crate feature http only.
§

impl TargetHttpVersionInputExt for Parts

§

impl<Body> TargetHttpVersionInputExt for Request<Body>