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: CacheMode
Determines the manager behavior.
manager: T
Manager 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more