pub struct CacheOptions {
pub ttl: Option<Duration>,
pub stale_while_revalidate: Option<Duration>,
pub tags: Vec<String>,
pub dependencies: Vec<String>,
pub cost: Option<u64>,
pub early_refresh: bool,
pub coalesce: bool,
pub etag: Option<String>,
pub negative: bool,
pub if_version: Option<u64>,
}Expand description
Configuration options for a cache entry
Fields§
§ttl: Option<Duration>Time-to-live
stale_while_revalidate: Option<Duration>Stale-while-revalidate window
Tags for invalidation
dependencies: Vec<String>Dependencies (keys this entry depends on)
cost: Option<u64>Computation cost (for cost-aware eviction)
early_refresh: boolEnable early refresh
coalesce: boolEnable request coalescing
etag: Option<String>ETag for HTTP caching
negative: boolMark as negative cache entry
if_version: Option<u64>Conditional set: only if version matches
Trait Implementations§
Source§impl Clone for CacheOptions
impl Clone for CacheOptions
Source§fn clone(&self) -> CacheOptions
fn clone(&self) -> CacheOptions
Returns a duplicate 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 CacheOptions
impl Debug for CacheOptions
Source§impl Default for CacheOptions
impl Default for CacheOptions
Source§fn default() -> CacheOptions
fn default() -> CacheOptions
Returns the “default value” for a type. Read more
Source§impl From<CacheOpts> for CacheOptions
impl From<CacheOpts> for CacheOptions
Source§fn from(opts: CacheOpts) -> CacheOptions
fn from(opts: CacheOpts) -> CacheOptions
Converts to this type from the input type.
Source§impl From<Duration> for CacheOptions
impl From<Duration> for CacheOptions
Source§fn from(ttl: Duration) -> CacheOptions
fn from(ttl: Duration) -> CacheOptions
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CacheOptions
impl RefUnwindSafe for CacheOptions
impl Send for CacheOptions
impl Sync for CacheOptions
impl Unpin for CacheOptions
impl UnwindSafe for CacheOptions
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