Struct http_cache_reqwest::HttpCacheOptions
source · pub struct HttpCacheOptions {
pub cache_options: Option<CacheOptions>,
pub cache_key: Option<Arc<dyn Fn(&Parts) -> String + Send + Sync>>,
pub cache_mode_fn: Option<Arc<dyn Fn(&Parts) -> CacheMode + Send + Sync>>,
pub cache_bust: Option<Arc<dyn Fn(&Parts, &Option<Arc<dyn Fn(&Parts) -> String + Send + Sync>>, &str) -> Vec<String> + Send + Sync>>,
}
Expand description
Can be used to override the default CacheOptions
and cache key.
The cache key is a closure that takes http::request::Parts
and returns a String
.
Fields§
§cache_options: Option<CacheOptions>
Override the default cache options.
cache_key: Option<Arc<dyn Fn(&Parts) -> String + Send + Sync>>
Override the default cache key generator.
cache_mode_fn: Option<Arc<dyn Fn(&Parts) -> CacheMode + Send + Sync>>
Override the default cache mode.
cache_bust: Option<Arc<dyn Fn(&Parts, &Option<Arc<dyn Fn(&Parts) -> String + Send + Sync>>, &str) -> Vec<String> + Send + Sync>>
Bust the caches of the returned keys.
Trait Implementations§
source§impl Clone for HttpCacheOptions
impl Clone for HttpCacheOptions
source§fn clone(&self) -> HttpCacheOptions
fn clone(&self) -> HttpCacheOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HttpCacheOptions
impl Debug for HttpCacheOptions
source§impl Default for HttpCacheOptions
impl Default for HttpCacheOptions
source§fn default() -> HttpCacheOptions
fn default() -> HttpCacheOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for HttpCacheOptions
impl Send for HttpCacheOptions
impl Sync for HttpCacheOptions
impl Unpin for HttpCacheOptions
impl !UnwindSafe for HttpCacheOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more