Skip to main content

Module source

Module source 

Source
Expand description

The settings a process reads: the source its host installed.

The session installs its settings as resources of the workspace; a sandboxed app installs its channel to the session; a service the session started, and a browser page, install a HostDocument of what their host gives them; a window of the toolkit alone installs none. A process with none installed reads every setting’s default.

Structs§

ChangeOrigin
ChangeSignal
DeferredFailure
HostDocument
SettingsStamp
One version of the document a SettingsSource holds, for readers that follow it.
SourceScope

Enums§

ConditionalUpdate

Traits§

SettingsSource

Functions§

compare_update_section
SettingsSource::compare_update_sections of one section: merge values into name only if it still holds expected.
install_source
Make source the settings document of this process, or restore the local profile with None. A host does this once, as it starts; a test that needs a document of its own takes a scoped_source, which no other test sees.
installed_source
installed_version
The version of source as this process reads it: the document’s own revision, told apart from every document installed in another’s place before it, so a reader that caches what it read by version reads a replaced document again even where the two number alike. A reader told only the document’s own revision takes a document put in place of another for the one it replaced, and keeps reading what the old one said.
keep_profile
Keep the settings of the profile at root in what source makes, in place of its own document (profile), unless something keeps them already: what a host that keeps a person’s settings as resources of a workspace gives the profile it opens a window on, so they are kept, stepped and read back as that host keeps the person’s, and a later window on the profile finds what an earlier one set.
load_section_in
Section name of what source holds, as section_of.
merge_section
Merge values into section name of doc, keeping every other section and every key values does not mention. A section of the wrong type is replaced: there is nothing to preserve in a value that cannot be read.
parse
A settings document’s body read as an object: anything else is the empty document, so a broken file reads as every setting’s default.
profile
The settings of a profile kept apart from the person’s (a headless app’s, a test’s, the models a host keeps for a workspace it serves), by its root: one per root for the life of the process, kept in the root’s settings.json, which a write replaces whole.
profile_source
The settings of the profile at root: what a host gave it to keep them (keep_profile), else its own document (profile).
register_fallback
Where this process reads its settings when its host installed none: what the profile’s session left for processes outside it, for a process started outside the session. The process’s starter registers it (its main, or the app runner as it starts an app), never a library: a process that registered none reads every setting’s default.
scoped_source
section_of
Section name of doc as an object. A missing section, or one that is not an object, yields an empty map.
source
The settings of this process: the source its host installed, else the fallback its starter registered (register_fallback); None where there is neither, and every setting reads as its default.

Type Aliases§

Fallback
What gives the settings a process reads when its host installed none.
Listener
What a reader runs when the document changed: hand the news on, nothing slow; it runs on the thread that made or noticed the change.
SectionChange
What a read-modify-write makes of the current section: the leaves to merge into it. Called once, with the section as stored at that moment.