pub struct PersistenceConfig {
pub registry: Option<Arc<StateRegistry>>,
pub checkpoint_interval: Option<Duration>,
pub auto_load: bool,
pub auto_save: bool,
}Expand description
Configuration for state persistence in the program runtime.
Controls when and how widget state is saved/restored.
Fields§
§registry: Option<Arc<StateRegistry>>State registry for persistence. If None, persistence is disabled.
checkpoint_interval: Option<Duration>Interval for periodic checkpoint saves. None disables checkpoints.
auto_load: boolAutomatically load state on program start.
auto_save: boolAutomatically save state on program exit.
Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
Sourcepub fn with_registry(registry: Arc<StateRegistry>) -> Self
pub fn with_registry(registry: Arc<StateRegistry>) -> Self
Create a persistence config with the given registry.
Sourcepub fn checkpoint_every(self, interval: Duration) -> Self
pub fn checkpoint_every(self, interval: Duration) -> Self
Set the checkpoint interval.
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