Skip to main content

Module settings

Module settings 

Source
Expand description

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)

use digdigdig3_station::SettingsStore;

let mut store = SettingsStore::open("./my_app", "ui-state").await?;
store.set("theme", &"dark")?;
store.save().await?;

§Usage (wasm32)

let mut store = SettingsStore::open("ui-state").await?;
store.set("theme", &"dark")?;
store.save().await?;

Structs§

SettingsStore
Native JSON settings store.

Enums§

SettingsError
Errors from SettingsStore operations.