pub struct CacheConfig {Show 14 fields
pub max_memory_size: usize,
pub max_disk_size: usize,
pub compress: bool,
pub compress_threshold: usize,
pub eviction_strategy: EvictionStrategy,
pub persistent: bool,
pub cache_dir: Option<PathBuf>,
pub default_ttl: Option<Duration>,
pub max_age: Option<Duration>,
pub max_entries: usize,
pub warming_strategy: WarmingStrategy,
pub warm_batch_size: usize,
pub spatial_aware: bool,
pub arc_adaptation_rate: f64,
}Expand description
Cache configuration
Fields§
§max_memory_size: usizeMaximum memory cache size in bytes
max_disk_size: usizeMaximum disk cache size in bytes
compress: boolWhether to enable compression
compress_threshold: usizeCompression threshold (compress if larger than this)
eviction_strategy: EvictionStrategyEviction strategy
persistent: boolWhether to enable persistent disk cache
cache_dir: Option<PathBuf>Disk cache directory
default_ttl: Option<Duration>Default TTL for entries
max_age: Option<Duration>Maximum entry age before eviction
max_entries: usizeMaximum number of entries
warming_strategy: WarmingStrategyCache warming strategy
warm_batch_size: usizeNumber of entries to warm at a time
spatial_aware: boolWhether to track spatial metadata
arc_adaptation_rate: f64Target ARC adaptation rate (0.0-1.0)
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn with_max_memory_size(self, size: usize) -> Self
pub fn with_max_memory_size(self, size: usize) -> Self
Sets the maximum memory cache size
Sourcepub fn with_max_disk_size(self, size: usize) -> Self
pub fn with_max_disk_size(self, size: usize) -> Self
Sets the maximum disk cache size
Sourcepub fn with_compress(self, compress: bool) -> Self
pub fn with_compress(self, compress: bool) -> Self
Enables or disables compression
Sourcepub fn with_eviction_strategy(self, strategy: EvictionStrategy) -> Self
pub fn with_eviction_strategy(self, strategy: EvictionStrategy) -> Self
Sets the eviction strategy
Sourcepub fn with_cache_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_cache_dir(self, dir: impl Into<PathBuf>) -> Self
Sets the cache directory
Sourcepub fn with_default_ttl(self, ttl: Duration) -> Self
pub fn with_default_ttl(self, ttl: Duration) -> Self
Sets the default TTL
Sourcepub fn with_max_age(self, duration: Duration) -> Self
pub fn with_max_age(self, duration: Duration) -> Self
Sets the maximum entry age
Sourcepub fn with_max_entries(self, count: usize) -> Self
pub fn with_max_entries(self, count: usize) -> Self
Sets the maximum number of entries
Sourcepub fn with_warming_strategy(self, strategy: WarmingStrategy) -> Self
pub fn with_warming_strategy(self, strategy: WarmingStrategy) -> Self
Sets the warming strategy
Sourcepub fn with_spatial_aware(self, enabled: bool) -> Self
pub fn with_spatial_aware(self, enabled: bool) -> Self
Enables spatial awareness
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.