Struct http_cache_reqwest::HttpCache
source · pub struct HttpCache<T>where
T: CacheManager,{
pub mode: CacheMode,
pub manager: T,
pub options: Option<CacheOptions>,
}Expand description
Caches requests according to http spec.
Fields§
§mode: CacheModeDetermines the manager behavior.
manager: TManager instance that implements the CacheManager trait.
By default, a manager implementation with cacache
as the backend has been provided, see CACacheManager.
options: Option<CacheOptions>Override the default cache options.
Implementations§
source§impl<T> HttpCache<T>where
T: CacheManager,
impl<T> HttpCache<T>where T: CacheManager,
sourcepub async fn run(
&self,
middleware: impl Middleware
) -> impl Future<Output = Result<HttpResponse, CacheError>>
pub async fn run( &self, middleware: impl Middleware ) -> impl Future<Output = Result<HttpResponse, CacheError>>
Attempts to run the passed middleware along with the cache