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
impl Setup
Sourcepub fn new(
config: Config,
dirs: &HostDirs,
gates: &Gates,
host: InstallHost,
installer: Installer,
system: Option<&str>,
) -> Self
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.
Sourcepub fn for_step(
config: Config,
dirs: &HostDirs,
gates: &Gates,
host: InstallHost,
installer: Installer,
system: Option<&str>,
step: SetupStep,
) -> Self
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.
Sourcepub fn is_alone(&self) -> bool
pub fn is_alone(&self) -> bool
Whether the wizard is asking one step on its own rather than walking all three.
Sourcepub fn language(&self) -> &'static str
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.
Sourcepub fn languages(&self) -> &Languages
pub fn languages(&self) -> &Languages
The languages as the step offers them: the machine’s own first, the rest alphabetical.
Sourcepub fn engine_name(&self) -> &'static str
pub fn engine_name(&self) -> &'static str
The engine the person chose, as the config file writes it.
Sourcepub fn engine_check(&self) -> &EngineCheck
pub fn engine_check(&self) -> &EngineCheck
What the chosen engine last answered.
Sourcepub fn folder_path(&self) -> Option<&Path>
pub fn folder_path(&self) -> Option<&Path>
Where the store will be, once there is an answer to that at all.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the wizard is through: everything is settled and written down.
Sourcepub fn into_config(self) -> Config
pub fn into_config(self) -> Config
Hands the settings back when the wizard is done with them.
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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