Skip to main content

KeyExtractor

Trait KeyExtractor 

Source
pub trait KeyExtractor:
    Clone
    + Send
    + Sync
    + Debug
    + 'static {
    type Key: Clone + Send + Sync + Debug + Hash + Eq + 'static;

    // Required method
    fn extract<T>(&self, req: &Request<T>) -> Result<Self::Key, CacheError>;
}
Expand description

Trait to extract the caching key from the given HTTP request

Required Associated Types§

Source

type Key: Clone + Send + Sync + Debug + Hash + Eq + 'static

The type of the key.

Required Methods§

Source

fn extract<T>(&self, req: &Request<T>) -> Result<Self::Key, CacheError>

Extraction method, will return Error response when the extraction failed

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§