pub struct CacheConfig {
pub max_size_bytes: u64,
pub min_free_space: u64,
pub max_age_secs: u64,
pub auto_cleanup: bool,
pub cleanup_threshold: f64,
pub cleanup_target: f64,
}Expand description
Cache configuration
Fields§
§max_size_bytes: u64Maximum cache size in bytes (0 = unlimited)
min_free_space: u64Minimum free space to maintain (in bytes)
max_age_secs: u64Maximum age for unused models (in seconds, 0 = unlimited)
auto_cleanup: boolEnable automatic cleanup
cleanup_threshold: f64Cleanup threshold (trigger when usage exceeds this percentage)
cleanup_target: f64Target usage after cleanup (percentage)
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn with_max_size_gb(self, gb: f64) -> Self
pub fn with_max_size_gb(self, gb: f64) -> Self
Set maximum cache size in GB
Sourcepub fn with_max_size_bytes(self, bytes: u64) -> Self
pub fn with_max_size_bytes(self, bytes: u64) -> Self
Set maximum cache size in bytes
Sourcepub fn with_min_free_space_gb(self, gb: f64) -> Self
pub fn with_min_free_space_gb(self, gb: f64) -> Self
Set minimum free space in GB
Sourcepub fn with_max_age_days(self, days: u64) -> Self
pub fn with_max_age_days(self, days: u64) -> Self
Set maximum age for unused models in days
Sourcepub fn with_auto_cleanup(self, enabled: bool) -> Self
pub fn with_auto_cleanup(self, enabled: bool) -> Self
Enable/disable auto cleanup
Sourcepub fn with_cleanup_threshold(self, threshold: f64) -> Self
pub fn with_cleanup_threshold(self, threshold: f64) -> Self
Set cleanup threshold (percentage)
Sourcepub fn with_cleanup_target(self, target: f64) -> Self
pub fn with_cleanup_target(self, target: f64) -> Self
Set cleanup target (percentage)
Sourcepub fn max_size_gb(&self) -> f64
pub fn max_size_gb(&self) -> f64
Get max size in GB
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 (const: unstable) · 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 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