CacheManager

Trait CacheManager 

Source
pub trait CacheManager {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: &'life1 Request,
    ) -> Pin<Box<dyn Future<Output = Result<Option<(Response, CachePolicy)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn put<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: &'life1 Request,
        res: Response,
        policy: CachePolicy,
    ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: &'life1 Request,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait providing methods for storing, reading, and removing cache records.

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 Request, ) -> Pin<Box<dyn Future<Output = Result<Option<(Response, CachePolicy)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Attempts to pull a cached reponse and related policy from cache.

Source

fn put<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 Request, res: Response, policy: CachePolicy, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Attempts to cache a response and related policy.

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, req: &'life1 Request, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Attempts to remove a record from cache.

Implementors§