pub struct TtlConfig {
pub sample_size: usize,
pub expiry_threshold: f32,
pub max_iterations: usize,
pub max_time_per_run: Duration,
pub sleep_interval: Duration,
pub enabled: bool,
}
Expand description
Configuration for TTL cleaner background thread
Fields§
§sample_size: usize
Number of keys to sample per batch
expiry_threshold: f32
Continue sampling if expiry rate exceeds this threshold (0.0-1.0)
max_iterations: usize
Maximum iterations per cleaning run
max_time_per_run: Duration
Maximum time to spend per cleaning run
sleep_interval: Duration
Sleep interval between cleaning runs
enabled: bool
Whether TTL cleaner is enabled
Implementations§
Source§impl TtlConfig
impl TtlConfig
Sourcepub fn default_persistent() -> Self
pub fn default_persistent() -> Self
Create a default configuration for persistent stores
Sourcepub fn default_memory() -> Self
pub fn default_memory() -> Self
Create a default configuration for memory-only stores
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TtlConfig
impl RefUnwindSafe for TtlConfig
impl Send for TtlConfig
impl Sync for TtlConfig
impl Unpin for TtlConfig
impl UnwindSafe for TtlConfig
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