Skip to main content

Setup

Struct Setup 

Source
pub struct Setup { /* private fields */ }
Expand description

The setup wizard’s state.

It owns the Config while it runs, because settling these three questions is writing that file: the engine, the store and the flag that keeps the wizard from opening again are written when the last step is finished. Setup::into_config hands it back.

Implementations§

Source§

impl Setup

Source

pub fn new( config: Config, dirs: &HostDirs, gates: &Gates, host: InstallHost, installer: Installer, system: Option<&str>, ) -> Self

A wizard for config on the machine dirs and host describe, opened on the first gate of gates that does not hold.

The gates are asked before the screen appears, not by the screen: their answers decide whether the wizard is needed at all, and the one who asks that question already has them.

system is the language the machine itself is set to, which decides the first row of the language step and, until the person has chosen one, the row that is chosen. It is handed in rather than read here so that a test says what machine it is describing.

Source

pub fn for_step( config: Config, dirs: &HostDirs, gates: &Gates, host: InstallHost, installer: Installer, system: Option<&str>, step: SetupStep, ) -> Self

A wizard that asks step alone, for a setting that has to be put right after the setup was finished: the engine that has gone missing, or a store that has to move.

It shows that one step and finishes on it, so the person is not walked through questions they answered long ago. What it writes is what that step settles; the flag that keeps the wizard from opening at every start is already written and stays written.

Source

pub fn is_alone(&self) -> bool

Whether the wizard is asking one step on its own rather than walking all three.

Source

pub fn step(&self) -> SetupStep

Which step the wizard is on.

Source

pub fn language(&self) -> &'static str

The language the person chose, as the config file writes it.

The wizard applies it to the running application itself; storing it is the caller’s, because the language belongs to the whole application and not to this screen.

Source

pub fn languages(&self) -> &Languages

The languages as the step offers them: the machine’s own first, the rest alphabetical.

Source

pub fn engine_name(&self) -> &'static str

The engine the person chose, as the config file writes it.

Source

pub fn engine_check(&self) -> &EngineCheck

What the chosen engine last answered.

Source

pub fn folder_path(&self) -> Option<&Path>

Where the store will be, once there is an answer to that at all.

Source

pub fn is_finished(&self) -> bool

Whether the wizard is through: everything is settled and written down.

Source

pub fn config(&self) -> &Config

The settings, to read what the wizard has written.

Source

pub fn into_config(self) -> Config

Hands the settings back when the wizard is done with them.

Trait Implementations§

Source§

impl Debug for Setup

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Setup

§

impl !UnwindSafe for Setup

§

impl Freeze for Setup

§

impl Send for Setup

§

impl Sync for Setup

§

impl Unpin for Setup

§

impl UnsafeUnpin for Setup

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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, 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, !>

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.