pub struct CacheConfig {
pub max_size: usize,
pub ttl_seconds: u64,
pub cleanup_interval_seconds: u64,
pub auto_cleanup: bool,
pub soft_limit_ratio: f64,
pub cleanup_batch_size: usize,
}
Expand description
Cache configuration
Fields§
§max_size: usize
Maximum number of entries
ttl_seconds: u64
TTL (seconds)
cleanup_interval_seconds: u64
Cleanup interval (seconds)
auto_cleanup: bool
Enable auto cleanup
soft_limit_ratio: f64
Soft limit cleanup threshold (start cleanup when exceeded)
cleanup_batch_size: usize
Max entries to clean per batch
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn ttl_seconds(self, seconds: u64) -> Self
pub fn ttl_seconds(self, seconds: u64) -> Self
Set TTL (seconds)
Sourcepub fn ttl_minutes(self, minutes: u64) -> Self
pub fn ttl_minutes(self, minutes: u64) -> Self
Set TTL (minutes)
Sourcepub fn cleanup_interval_seconds(self, seconds: u64) -> Self
pub fn cleanup_interval_seconds(self, seconds: u64) -> Self
Set cleanup interval (seconds)
Sourcepub fn disable_auto_cleanup(self) -> Self
pub fn disable_auto_cleanup(self) -> Self
Disable auto cleanup
Sourcepub fn soft_limit_ratio(self, ratio: f64) -> Self
pub fn soft_limit_ratio(self, ratio: f64) -> Self
Set soft limit ratio (start cleanup when exceeded)
Sourcepub fn cleanup_batch_size(self, size: usize) -> Self
pub fn cleanup_batch_size(self, size: usize) -> Self
Set max entries to clean per batch
Sourcepub fn validate(&self) -> AuthResult<()>
pub fn validate(&self) -> AuthResult<()>
Validate config
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 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