Skip to main content

Crate sapphire_framework_settings

Crate sapphire_framework_settings 

Source
Expand description

The settings registry: which settings exist, who owns them, and what they resolve to.

Each process that has settings (the bridge, an app server) is a SettingsOwner. A Registry merges the owners’ definitions into one namespace keyed by TOML path; list and get read the scope files and resolve each key’s effective value; apply writes a batch of changes, validated as a whole, keeping comments.

Modules§

gui
The keys of the GUI’s settings: stored by the bridge, read by the apps’ windows.

Structs§

Applied
What a batch changed.
Entry
One setting as reported to a client.
FieldError
One problem an owner found while validating.
Registry
Every owner’s definitions in one namespace, checked for clashes.
SettingDef
The registry’s description of one setting.
Staged
The edited text of the files a batch touches, before it is written.
StartState
The effective values of the restart-only keys when the process started, to tell which changes are written but not yet in effect.

Enums§

Apply
When a changed setting takes effect.
EntryValue
What get/list report for a key.
Error
Why a settings operation failed.
Kind
The type of a setting’s value, and so what it accepts.
Op
One change in a batch.
Origin
Where the effective value came from.
Process
Which process owns a setting: the one that stores, validates and applies it.
Scope
Where a setting is stored. Ordered as declared: device, workgroup, workspace.
SecretState
Whether a secret has a value; the value itself is never exposed.
Value
A typed setting value.

Constants§

SERVER_NAMES
The top-level names the app server’s framework keeps for itself, whether or not it defines keys there: an application declares its own top-level names beside these, never one of them. Adding a name here is a breaking change.

Traits§

SettingsOwner
A process that has settings: it defines them and says where its scope files live.

Functions§

apply
Apply ops to the scope files, all or nothing.
check
Everything apply does up to and including the owners’ validate, writing nothing: the same Applied, or the same error, that apply would produce.
describe_toml_error
A TOML parse error of text as the line and column it is at and what is wrong, never the text itself: a settings file may hold an application’s tokens beside the settings. span and message are the error’s own (toml::de::Error, toml_edit::TomlError).
get
The effective value of one key.
list
List settings: every key’s effective value, or with a scope only what that scope’s file holds (shown with the value it holds). start marks pending restarts.
write_atomic
Write text to path through a temp file and a rename, creating the directory.
write_private
Like write_atomic, but the file is readable by its owner only (0600 on unix).

Type Aliases§

Result
Result alias for this crate.