Struct http_cache_reqwest::HttpCacheOptions
source · pub struct HttpCacheOptions {
pub cache_options: Option<CacheOptions>,
pub cache_key: Option<Arc<dyn Fn(&Parts) -> String + Sync + Send>>,
pub cache_mode_fn: Option<Arc<dyn Fn(&Parts) -> CacheMode + Sync + Send>>,
pub cache_bust: Option<Arc<dyn Fn(&Parts, &Option<Arc<dyn Fn(&Parts) -> String + Sync + Send>>, &str) -> Vec<String> + Sync + Send>>,
}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 + Sync + Send>>Override the default cache key generator.
cache_mode_fn: Option<Arc<dyn Fn(&Parts) -> CacheMode + Sync + Send>>Override the default cache mode.
cache_bust: Option<Arc<dyn Fn(&Parts, &Option<Arc<dyn Fn(&Parts) -> String + Sync + Send>>, &str) -> Vec<String> + Sync + Send>>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 Freeze for HttpCacheOptions
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