origin_settings/lib.rs
1//! Typed user settings.
2//!
3//! A setting is declared once as a [`Setting`] constant — key and default in one
4//! place — and read through [`Settings`]. Nothing addresses settings by loose string.
5//!
6//! ```
7//! # use origin_settings::Setting;
8//! pub const THEME: Setting<String> = Setting::new("ui.theme", || String::from("system"));
9//! ```
10
11mod settings;
12mod store;
13
14pub use settings::{Setting, Settings};
15pub use store::{SettingsStore, StorageSettingsStore};
16
17/// Storage namespace used for settings records.
18pub const SETTINGS_NAMESPACE: &str = "origin.settings";