Skip to main content

TargetHttpVersionInputExt

Trait TargetHttpVersionInputExt 

Source
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 http 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§

Source

fn target_http_version(&self) -> Option<Version>

The selected egress HTTP version, or None if none is available.

Provided Methods§

Source

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§

Source§

impl<T: TargetHttpVersionInputExt + ?Sized> TargetHttpVersionInputExt for &T

Implementors§

Source§

impl TargetHttpVersionInputExt for ConnectRequest

Available on crate feature std only.