Skip to main content

CachePolicy

Trait CachePolicy 

Source
pub trait CachePolicy:
    Default
    + Clone
    + Send
    + Sync
    + 'static {
    type Store: CacheStore + Send + Sync + 'static;

    // Provided methods
    fn cache_key(
        &self,
        ctx: &RequestContext,
        req: &Request<Body>,
    ) -> Option<String> { ... }
    fn ttl_seconds(&self) -> Option<u64> { ... }
    fn should_cache_response(&self, response: &Response) -> bool { ... }
}

Required Associated Types§

Source

type Store: CacheStore + Send + Sync + 'static

Provided Methods§

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<S> CachePolicy for DefaultCachePolicy<S>
where S: CacheStore + Send + Sync + 'static,

Source§

type Store = S