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
sourceimpl<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
Trait Implementations
sourceimpl<T: Clone + CacheManager> Clone for HttpCache<T>
impl<T: Clone + CacheManager> Clone for HttpCache<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for HttpCache<T>where
T: RefUnwindSafe,
impl<T> Send for HttpCache<T>
impl<T> Sync for HttpCache<T>
impl<T> Unpin for HttpCache<T>where
T: Unpin,
impl<T> UnwindSafe for HttpCache<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more