Skip to main content

ConfigRow

Struct ConfigRow 

Source
pub struct ConfigRow {
    pub key: &'static str,
    pub category: &'static str,
    pub help: &'static str,
    pub plain: &'static str,
    pub control: Control,
    pub value: String,
    pub original: String,
    pub default: String,
    pub recommended: Option<&'static str>,
    pub is_new: bool,
}
Expand description

One setting, as the view needs it.

Fields§

§key: &'static str§category: &'static str

The heading this row is drawn under. Rows sharing one are drawn together, in the order they arrive; the caller owns which group a setting is in.

§help: &'static str§plain: &'static str

The same setting said again without jargon, shown under help rather than instead of it. Someone who knows what a build tree is skips the second line; someone who does not was going to guess, and guessing is how a setting gets turned on for the wrong reason.

§control: Control§value: String

The value, spelled the way devp config set would take it.

§original: String

What it was when the view opened, so the summary shows only real changes.

§default: String

What a fresh install would hold, spelled the same way as value.

Not the same question as original, which is what this machine happens to hold. Somebody looking at a setting they have never touched cannot tell those apart, and the one they need in order to decide whether to touch it is this one.

§recommended: Option<&'static str>

The value the first-run screen suggests, if this setting is suggested at all.

A recommendation, never a requirement: everything here works with all of them declined. It is shown on every visit rather than only on the first run, because the screen that suggested it appears once and the settings list is forever.

§is_new: bool

Introduced in a release newer than the one this machine last reviewed at.

Implementations§

Source§

impl ConfigRow

Source

pub fn changed(&self) -> bool

Source

pub fn takes_advice(&self) -> Option<bool>

Whether this row already holds what is recommended for it.

None when nothing is recommended, which is a different answer from “no” and is why the badge has three states rather than two.

Trait Implementations§

Source§

impl Clone for ConfigRow

Source§

fn clone(&self) -> ConfigRow

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.