pub struct SettingsHandle<T> { /* private fields */ }Implementations§
Source§impl<T> SettingsHandle<T>
impl<T> SettingsHandle<T>
Sourcepub fn new(initial: T, backend: Box<dyn StorageBackend>) -> Self
pub fn new(initial: T, backend: Box<dyn StorageBackend>) -> Self
Creates a settings handle and initializes diff state from the backend.
Sourcepub fn new_with_stored(
initial: T,
backend: Box<dyn StorageBackend>,
stored: HashMap<String, StoredValue>,
) -> Self
pub fn new_with_stored( initial: T, backend: Box<dyn StorageBackend>, stored: HashMap<String, StoredValue>, ) -> Self
Creates a settings handle with caller-provided persisted values.
This constructor is used when startup code has already loaded persisted values to resolve the initial settings snapshot. Passing the same map into the handle keeps the cross-process diff state aligned with that snapshot without reading the backend a second time.
Sourcepub fn new_with_stored_and_applier(
initial: T,
backend: Box<dyn StorageBackend>,
stored: HashMap<String, StoredValue>,
external_applier: ExternalApplier<T>,
) -> Self
pub fn new_with_stored_and_applier( initial: T, backend: Box<dyn StorageBackend>, stored: HashMap<String, StoredValue>, external_applier: ExternalApplier<T>, ) -> Self
Creates a settings handle with caller-provided persisted values and an external applier.
This constructor is used by generated settings code that has already
loaded stored values and can also map persisted storage keys back onto
fields in T. The applier is called when the cross-process diff loop
observes an external stored-value change; successful applications update
the in-memory snapshot before the corresponding change event is
broadcast.