origin-settings 0.2.0

Typed user settings for Origin, backed by any Storage implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Typed user settings.
//!
//! A setting is declared once as a [`Setting`] constant — key and default in one
//! place — and read through [`Settings`]. Nothing addresses settings by loose string.
//!
//! ```
//! # use origin_settings::Setting;
//! pub const THEME: Setting<String> = Setting::new("ui.theme", || String::from("system"));
//! ```

mod settings;
mod store;

pub use settings::{Setting, Settings};
pub use store::{SettingsStore, StorageSettingsStore};

/// Storage namespace used for settings records.
pub const SETTINGS_NAMESPACE: &str = "origin.settings";