Skip to main content

ConfigSession

Struct ConfigSession 

Source
pub struct ConfigSession<'a> {
    pub declaration: Vec<DeclarationLine>,
    pub standing: String,
    pub rows: Vec<ConfigRow>,
    pub suggestions: Vec<Suggestion>,
    pub adapters: &'a [&'static str],
    pub opt_in_adapters: &'a [&'static str],
    pub groups: &'a [(&'static str, &'static [&'static str])],
    pub validate: &'a dyn Fn(&str, &str) -> Result<(), String>,
    pub title: &'a str,
}
Expand description

Everything the view needs that it cannot work out for itself.

Fields§

§declaration: Vec<DeclarationLine>

Shown above the settings; in practice the devp trust report.

§standing: String

A one-line summary of what has and has not happened yet.

§rows: Vec<ConfigRow>§suggestions: Vec<Suggestion>

Settings worth turning on, shown once before the full list. Empty on every run but the first, which is the only time this screen appears at all.

§adapters: &'a [&'static str]

Every adapter name, in registry order, for the checklist.

§opt_in_adapters: &'a [&'static str]

Adapter names that need their own enable_* switch as well.

§groups: &'a [(&'static str, &'static [&'static str])]

The language groups the adapters are shown under, in display order. Anything not named by a group is collected under a trailing “Other”.

§validate: &'a dyn Fn(&str, &str) -> Result<(), String>

Round-trips one value through the setter that owns it. Err is shown in place and the edit is refused, so validation lives in exactly one place.

§title: &'a str

Title bar text — the walkthrough and config wizard arrive here differently.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for ConfigSession<'a>

§

impl<'a> !Send for ConfigSession<'a>

§

impl<'a> !Sync for ConfigSession<'a>

§

impl<'a> !UnwindSafe for ConfigSession<'a>

§

impl<'a> Freeze for ConfigSession<'a>

§

impl<'a> Unpin for ConfigSession<'a>

§

impl<'a> UnsafeUnpin for ConfigSession<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.