Skip to main content

Module settings

Module settings 

Source
Expand description

Application settings: typed store with all v1 defaults.

§Layout

  • mod.rsSettings struct, sub-structs, load/save, and SettingsHandle.
  • defaults.rsDefault for Settings with every v1 default from the proposal.

§Persistence

${app_config_dir}/settings.json is the canonical backing file. On save the file is written atomically (temp file + rename) so a crash during write cannot corrupt the stored settings.

§Forward-compatibility

The unknown field uses #[serde(flatten)] over a BTreeMap<String, Value>. Any JSON key that does not map to a known field is round-tripped verbatim, so settings written by a future app version are preserved when the user downgrades.

§OCP

Typed sub-structs (NotificationSettings, TransferConfirmations, …) make adding a new sub-field a non-breaking change — serde simply deserialises new keys into unknown on older builds and propagates them back on save.

Modules§

defaults 🔒
Default implementation for Settings.

Structs§

AutoUpdateSettings
Auto-update channel and behaviour.
NotificationSettings
Controls in-app and OS-level notification behaviour.
S3CompatibleEndpoint
A single S3-compatible endpoint entry in the endpoint registry.
Settings
All application settings, versioned and forward-compatible.
SettingsHandle
Newtype around Arc<Mutex<Settings>> used as Tauri managed state.
StartupBehavior
What the app does on startup.
TransferConfirmations
Confirmation thresholds for potentially destructive or billable operations.

Enums§

ProxyMode
HTTP proxy mode.

Functions§

validate_patch
Validate a JSON patch object before applying it to Settings.