Skip to main content

Crate settings_model

Crate settings_model 

Source
Expand description

What settings are, as data: where a typed setting lives and how far it travels (Scope, SettingsSchema), which kind of device reads it (DeviceClass), the names a theme is chosen by (theme), the sections every app reads (text_assistance, appearance, accessibility, day_schedule, control_hints, personal_dictionary) and the document a host installs for its process to read (source).

It keeps no file and draws nothing, so it builds for WebAssembly: settings-store keeps the person’s document and its typed keys, the toolkit reads and draws it.

Modules§

accessibility
The accessibility section’s screen-reader settings, which every toolkit app reads to run its narrator. The whole section, with the pointer, typing, hearing and vision assists Settings edits and the compositor applies, is the accessibility-settings crate’s model; it reads these through the definitions here, so the two cannot disagree about a default or a range.
appearance
The appearance section’s plain leaves and bounds, which the toolkit draws by and the settings store’s typed keys write within. The schedule is crate::day_schedule’s.
control_hints
What the person has learned of the desktop’s own controls, so each hint teaches one thing once, whichever of their devices they are on; and whether hints show at all.
day_schedule
When the day ends: the one schedule automatic light/dark and night light share.
dock_edge
The edge a panel kept at the screen’s edges docks to, as the person’s settings name it.
personal_dictionary
The person’s personal vocabulary, shared by every input surface that checks or helps with spelling: the word processor, the on-screen keyboard and dictation.
source
The settings a process reads: the source its host installed.
text_assistance
The shared spelling preferences: the per-user text_assistance section every app’s text fields follow.
theme
The names a theme is chosen by: the looks Tilo ships, each designed for light and dark, the presets those make, and the spacing scale a person picks. The palettes and documents they stand for are the toolkit’s.

Macros§

settings_codec
SettingsSchema::from_settings_value and SettingsSchema::to_settings_value compiled where the impl is, never in the crates that read the setting: for a large settings type whose crate is in the shared runtime or an engine, every app or pane reading it otherwise carries its own copy of serde’s decoder.

Enums§

DeviceClass
Scope
Where an app’s typed settings live and how far they travel. Settings follow a person or a device, never a workspace’s members; they are never visible to members.

Constants§

APP_DEVICE_LOCAL_SECTION
APP_PERSONAL_SECTION
The section holding every app’s settings that follow the person, one object per app id: an app’s typed settings declare where each belongs, and only those that follow the person are written here.
MAX_PERSONAL_VALUE_BYTES
The largest value of the person’s, as JSON text, that their devices carry. An app’s entry in APP_PERSONAL_SECTION is one value, so its whole object must fit.

Traits§

SettingsSchema
A typed settings value with a declared Scope.