pub trait VersionPredicate: Sized {
// Required method
fn version(self, operation: Operation) -> HttpVersion<Self>;
}Expand description
Extension trait for adding version matching to a predicate chain.
§For Callers
Chain this to match requests or responses by their HTTP protocol version. Useful for applying different caching strategies based on HTTP/1.1 vs HTTP/2.
§For Implementors
This trait is automatically implemented for all Predicate
types. You don’t need to implement it manually.
Required Methods§
Sourcefn version(self, operation: Operation) -> HttpVersion<Self>
fn version(self, operation: Operation) -> HttpVersion<Self>
Adds a version match to this predicate chain.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".