pub struct CacheConfig {
pub default_ttl: Duration,
pub max_entries: usize,
pub cacheable_methods: HashSet<String>,
pub tier_resolver: Option<CacheTierResolver>,
}Expand description
Configuration for the response cache.
Fields§
§default_ttl: DurationDefault time-to-live for cached entries.
When tier_resolver is None, this TTL is used for all entries in
cacheable_methods. When a tier resolver is present, this is used as
a fallback only if a tier’s default TTL is somehow None.
max_entries: usizeMaximum number of entries to store.
cacheable_methods: HashSet<String>Set of RPC method names that are eligible for caching.
When tier_resolver is None, only methods in this set are cached.
When tier_resolver is Some, this set is ignored and the resolver
decides cacheability (any tier except NeverCache).
tier_resolver: Option<CacheTierResolver>Optional tier resolver for tiered caching.
When Some, the resolver classifies each request into a CacheTier
and applies tier-specific TTLs. When None, the cache uses the flat
default_ttl + cacheable_methods behavior.
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
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 CacheConfig
impl Debug for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnsafeUnpin for CacheConfig
impl UnwindSafe for CacheConfig
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