Trait surf_middleware_cache::CacheManager [−][src]
pub trait CacheManager {
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 Request
) -> Pin<Box<dyn Future<Output = Result<Option<(Response, CachePolicy)>, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 Request,
res: &'life2 mut Response,
policy: CachePolicy
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 Request
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
A trait providing methods for storing, reading, and removing cache records.
Required methods
Attempts to pull a cached reponse and related policy from cache.
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 Request,
res: &'life2 mut Response,
policy: CachePolicy
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 Request,
res: &'life2 mut Response,
policy: CachePolicy
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Attempts to cache a response and related policy.