Struct http_cache::HttpCache
source · pub struct HttpCache<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: CacheManager> HttpCache<T>
impl<T: CacheManager> HttpCache<T>
sourcepub async fn run(&self, middleware: impl Middleware) -> Result<HttpResponse>
pub async fn run(&self, middleware: impl Middleware) -> Result<HttpResponse>
Attempts to run the passed middleware along with the cache