pub struct Version<E> { /* private fields */ }Expand description
Extracts the HTTP protocol version as a cache key part.
Generates a key part with name "version" and value like "HTTP/1.1" or "HTTP/2".
§Examples
use hitbox_http::extractors::{Method, version::VersionExtractor};
// Include version in cache key
let extractor = Method::new().version();Implementations§
Source§impl<S> Version<NeutralExtractor<S>>
impl<S> Version<NeutralExtractor<S>>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a version extractor for cache key generation.
Adds a key part with name "version" and the HTTP protocol version
as value (e.g., "HTTP/1.1", "HTTP/2").
Chain onto existing extractors using VersionExtractor::version instead
if you already have an extractor chain.
Trait Implementations§
Source§impl<S> Default for Version<NeutralExtractor<S>>
impl<S> Default for Version<NeutralExtractor<S>>
Auto Trait Implementations§
impl<E> Freeze for Version<E>where
E: Freeze,
impl<E> RefUnwindSafe for Version<E>where
E: RefUnwindSafe,
impl<E> Send for Version<E>where
E: Send,
impl<E> Sync for Version<E>where
E: Sync,
impl<E> Unpin for Version<E>where
E: Unpin,
impl<E> UnwindSafe for Version<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<E> BodyExtractor for Ewhere
E: Extractor,
impl<E> BodyExtractor for Ewhere
E: Extractor,
Source§fn body(self, extraction: BodyExtraction) -> Body<E>
fn body(self, extraction: BodyExtraction) -> Body<E>
Adds body extraction with the specified mode.
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