pub struct PersistenceConfig {
pub enabled: bool,
pub persistence_path: PathBuf,
pub mode: PersistenceMode,
pub strategy: PersistenceStrategy,
pub save_interval: Duration,
pub min_entries_threshold: usize,
pub max_entries: usize,
pub compression_enabled: bool,
pub compression_level: u32,
pub encryption_enabled: bool,
pub max_snapshot_age_secs: u64,
pub backup_count: usize,
}Expand description
Configuration for cache persistence
Fields§
§enabled: boolWhether persistence is enabled
persistence_path: PathBufPath to persistence file
mode: PersistenceModePersistence mode
strategy: PersistenceStrategyPersistence strategy
save_interval: DurationSave interval (for Interval strategy)
min_entries_threshold: usizeMinimum number of entries to trigger save
max_entries: usizeMaximum number of entries to keep in snapshot
compression_enabled: boolEnable compression for persisted data
compression_level: u32Compression level (0-9, higher = more compression)
encryption_enabled: boolEnable encryption for persisted data
max_snapshot_age_secs: u64Maximum age of snapshot before forcing full save (seconds)
backup_count: usizeNumber of backup snapshots to keep
Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
Sourcepub fn with_immediate_strategy(self) -> Self
pub fn with_immediate_strategy(self) -> Self
Enable immediate persistence strategy
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Enable interval-based persistence
Sourcepub fn with_shutdown_strategy(self) -> Self
pub fn with_shutdown_strategy(self) -> Self
Enable shutdown-only persistence
Sourcepub fn with_min_entries(self, threshold: usize) -> Self
pub fn with_min_entries(self, threshold: usize) -> Self
Set minimum entries threshold
Sourcepub fn with_max_entries(self, max: usize) -> Self
pub fn with_max_entries(self, max: usize) -> Self
Set maximum entries
Sourcepub fn with_compression(self, enabled: bool) -> Self
pub fn with_compression(self, enabled: bool) -> Self
Enable/disable compression
Sourcepub fn with_compression_level(self, level: u32) -> Self
pub fn with_compression_level(self, level: u32) -> Self
Set compression level
Sourcepub fn with_backup_count(self, count: usize) -> Self
pub fn with_backup_count(self, count: usize) -> Self
Set number of backups to keep
Trait Implementations§
Source§impl Clone for PersistenceConfig
impl Clone for PersistenceConfig
Source§fn clone(&self) -> PersistenceConfig
fn clone(&self) -> PersistenceConfig
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 PersistenceConfig
impl Debug for PersistenceConfig
Auto Trait Implementations§
impl Freeze for PersistenceConfig
impl RefUnwindSafe for PersistenceConfig
impl Send for PersistenceConfig
impl Sync for PersistenceConfig
impl Unpin for PersistenceConfig
impl UnsafeUnpin for PersistenceConfig
impl UnwindSafe for PersistenceConfig
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.