Skip to main content

Keyer

Trait Keyer 

Source
pub trait Keyer:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn cache_key<B>(&self, req: &Request<B>) -> String;
}
Expand description

A trait for generating cache keys from HTTP requests.

Required Methods§

Source

fn cache_key<B>(&self, req: &Request<B>) -> String

Generate a cache key for the given request.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Keyer for DefaultKeyer

Source§

impl Keyer for QueryKeyer

Source§

impl<F> Keyer for CustomKeyer<F>
where F: Fn(&Request<()>) -> String + Clone + Send + Sync + 'static,