pub trait PersistedContainer {
type Value;
// Required methods
fn get_to_persist(&self) -> Self::Value;
fn restore_persisted(&mut self, value: Self::Value);
}
Expand description
A container that can store and provide a persisted value. This is used in conjunction with PersistedLazy to define how to lazily get the value that should be persisted, and how to restore state when a persisted value is loaded during initialization.
Required Associated Types§
Required Methods§
Sourcefn get_to_persist(&self) -> Self::Value
fn get_to_persist(&self) -> Self::Value
Get the current value to persist in the store
Sourcefn restore_persisted(&mut self, value: Self::Value)
fn restore_persisted(&mut self, value: Self::Value)
Set the container’s value, based on value loaded from the store