pub struct CacheConfig {
pub policy: CachePolicy,
pub enable_warming: bool,
pub max_size_bytes: u64,
pub enable_compression: bool,
pub invalidation_strategy: InvalidationStrategy,
pub enable_stats: bool,
}Expand description
Cache configuration
Fields§
§policy: CachePolicyDefault cache policy
enable_warming: boolEnable cache warming on startup
max_size_bytes: u64Maximum cache size in bytes (0 = unlimited)
enable_compression: boolEnable cache compression
invalidation_strategy: InvalidationStrategyInvalidation strategy
enable_stats: boolEnable cache statistics tracking
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn with_max_size(self, max_size: usize) -> Self
pub fn with_max_size(self, max_size: usize) -> Self
Set the maximum cache size
Sourcepub fn with_warming(self, enable: bool) -> Self
pub fn with_warming(self, enable: bool) -> Self
Enable cache warming
Sourcepub fn with_max_bytes(self, max_bytes: u64) -> Self
pub fn with_max_bytes(self, max_bytes: u64) -> Self
Set maximum cache size in bytes
Sourcepub fn with_compression(self, enable: bool) -> Self
pub fn with_compression(self, enable: bool) -> Self
Enable compression
Sourcepub fn with_invalidation(self, strategy: InvalidationStrategy) -> Self
pub fn with_invalidation(self, strategy: InvalidationStrategy) -> Self
Set invalidation strategy
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
Source§impl Default for CacheConfig
impl Default for CacheConfig
Source§impl<'de> Deserialize<'de> for CacheConfig
impl<'de> Deserialize<'de> for CacheConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin 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