pub struct PreferencesAnswer {
pub lang: Option<Lang>,
pub core: CorePreferences,
pub welcomed: bool,
pub panel: bool,
pub tier: Option<Tier>,
pub appearance: Appearance,
pub proxying: Proxying,
pub chords: Vec<Chord>,
pub tags: Vec<SessionTags>,
pub theme: ThemeOverride,
}Expand description
Everything one person settled about their own copy of the city.
Whole rather than a dozen readings, because that is the record the file holds and because a screen that changes two of these at once must not be able to write one and drop the other.
This is the grammar of [ui] in the person’s own file as well as
the shape of the answer. The file is read through this type and
written by serialising it, so a key the file may hold and a field
the answer states are one declaration. A section that states only
some of them is read with the rest at the postures
PreferencesAnswer::default gives, and a key no field claims is
refused where it is written rather than ignored into a setting that
never takes effect.
Fields§
§lang: Option<Lang>The language this person reads the interface in, and nothing when they have never said.
Absent rather than a language this build picked for them: the
browser’s own tag is the only evidence anybody has before the
first choice, and a stated en here would overrule it on every
machine whose owner simply never opened the setting.
core: CorePreferencesPerformance settings read from [core], never stored in [ui].
welcomed: boolWhether this person has walked through the welcome once. The city decides whether setting up is needed; this only decides whether somebody who skipped it is asked again.
panel: boolWhether the panel beside a conversation is open.
tier: Option<Tier>The tier this person last chose, and nothing when they never chose one: the tier a first visit opens in is the page’s posture, and a stated tier here would overrule it on every machine whose owner never pressed the key.
appearance: Appearance§proxying: ProxyingWhich proxy rule an endpoint attached from now on starts with. An endpoint already attached keeps the rule the city recorded for it.
chords: Vec<Chord>The chords this person rebound, action order.
The tags this person gave sessions, in session order
(crates/wire/spec/Preference.lean §8-84).
theme: ThemeOverrideThe person’s colours laid over the built-in theme
(crates/wire/spec/Preference.lean D29).
Implementations§
Source§impl PreferencesAnswer
impl PreferencesAnswer
Sourcepub fn apply(&mut self, patch: PreferencePatch)
pub fn apply(&mut self, patch: PreferencePatch)
Lands one named change on this record.
Here rather than at the file: what a patch means is the patch’s
own rule, and a second application of it — in the store, in a
test, in whatever keeps these next — would be a second answer
to what Chord("") does.
Trait Implementations§
Source§impl Clone for PreferencesAnswer
impl Clone for PreferencesAnswer
Source§impl Debug for PreferencesAnswer
impl Debug for PreferencesAnswer
Source§impl Default for PreferencesAnswer
What a person who has settled nothing is answered.
impl Default for PreferencesAnswer
What a person who has settled nothing is answered.
The postures this build draws before anybody chooses, stated once
for the file’s reader and the answer’s reader together. panel is
the one that is not its type’s own default: the panel beside a
conversation is open until somebody closes it, so an unwritten file
has to say true where welcomed says false.