pub trait SettingsStore: Send + Sync {
// Required methods
fn scopes(&self) -> Vec<ValueScope>;
fn load(&self, scope: ValueScope) -> Result<Values, String>;
fn save(&self, scope: ValueScope, changes: &Changes) -> Result<(), String>;
// Provided methods
fn claims(&self, _setting: &str) -> bool { ... }
fn watch(
&self,
_scope: ValueScope,
_on_change: OnChange,
) -> Result<(), String> { ... }
fn problems(&self) -> Vec<String> { ... }
}Expand description
Where the settings are kept, as the host provides it. Every method
may be called from a thread other than the UI’s: save always is,
except on the web.
Required Methods§
Sourcefn scopes(&self) -> Vec<ValueScope>
fn scopes(&self) -> Vec<ValueScope>
The scopes it keeps (app, and host scopes such as a library).
Provided Methods§
Sourcefn claims(&self, _setting: &str) -> bool
fn claims(&self, _setting: &str) -> bool
Whether it keeps this setting (by id). Everything by default.