pub enum Operation {
Eq(Version),
In(Vec<Version>),
}Expand description
Operations for matching HTTP versions.
§Examples
use hitbox_http::predicates::version::Operation;
use http::Version;
// Match HTTP/2 only
let op = Operation::Eq(Version::HTTP_2);
assert!(op.check(Version::HTTP_2));
assert!(!op.check(Version::HTTP_11));
// Match HTTP/1.1 or HTTP/2
let op = Operation::In(vec![Version::HTTP_11, Version::HTTP_2]);
assert!(op.check(Version::HTTP_11));
assert!(op.check(Version::HTTP_2));Variants§
Eq(Version)
Use when caching should apply to a specific HTTP version only.
Best for HTTP/2-only features or HTTP/1.1 fallback scenarios.
In(Vec<Version>)
Use when caching should apply to multiple HTTP versions.
Best for supporting both HTTP/1.1 and HTTP/2 while excluding HTTP/1.0.
Implementations§
Trait Implementations§
impl Eq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.