1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! General-purpose JSON settings/state persistence store.
//!
//! Works on both native (file-backed) and wasm32 (OPFS-backed).
//! Keys are arbitrary strings; values are `serde_json::Value` so any
//! `serde::Serialize` / `serde::de::DeserializeOwned` type round-trips
//! through the store without a custom codec.
//!
//! # Usage (native)
//!
//! ```rust,no_run
//! # async fn example() -> Result<(), digdigdig3_station::SettingsError> {
//! use digdigdig3_station::SettingsStore;
//!
//! let mut store = SettingsStore::open("./my_app", "ui-state").await?;
//! store.set("theme", &"dark")?;
//! store.save().await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Usage (wasm32)
//!
//! ```rust,ignore
//! let mut store = SettingsStore::open("ui-state").await?;
//! store.set("theme", &"dark")?;
//! store.save().await?;
//! ```
use fmt;
// ── cfg-split (mirrors series/mod.rs exactly) ─────────────────────────────────
pub use SettingsStore;
// ── Shared error type ─────────────────────────────────────────────────────────
/// Errors from `SettingsStore` operations.
///
/// Both native and wasm32 impls use this single enum so call sites compile
/// unchanged on either target.