Skip to main content

WizardState

Struct WizardState 

Source
pub struct WizardState {
Show 31 fields pub language: Language, pub secret: String, pub online: Option<bool>, pub secret_checked: bool, pub folder: String, pub detected: Vec<Game>, pub game: Option<Game>, pub route: Route, pub base_url: String, pub cache: Cache, pub cache_override: Option<PathBuf>, pub packages: Vec<PackageInfo>, pub tree: Tree, pub tree_items: Vec<isize>, pub tree_syncing: bool, pub catalogue_loaded: bool, pub schema_mismatch: bool, pub download_started: bool, pub downloaded: usize, pub downloaded_bytes: u64, pub not_downloaded: Vec<NotDownloaded>, pub chosen: Vec<String>, pub config: Configuration, pub points: Vec<Point>, pub restore_to: Option<Point>, pub restore_plan: Plan, pub log: Log, pub cancel: Arc<AtomicBool>, pub install_started: bool, pub outcome: Option<Outcome>, request: usize,
}
Expand description

What the run accumulates, owned by the sheet and shared by every page.

Fields§

§language: Language§secret: String

The access key from scene 2; empty is anonymous.

§online: Option<bool>

None until GET /health answers.

§secret_checked: bool

Set once secret is accepted, so re-entering scene 2 does not re-check it.

§folder: String§detected: Vec<Game>

In Game::ALL order.

§game: Option<Game>

The single detection, or the user’s pick when the folder holds several games.

§route: Route§base_url: String§cache: Cache

The game folder’s own cache, opened when scene 3 settles the folder.

§cache_override: Option<PathBuf>

--cache <dir>, which wins over the game folder’s cache when given.

§packages: Vec<PackageInfo>

The catalogue behind the tree, whose sizes and digests scene 6 needs.

§tree: Tree§tree_items: Vec<isize>

HTREEITEM per tree node, by node index.

§tree_syncing: bool

Set while the model is pushed into the control, whose change notifications would recurse.

§catalogue_loaded: bool§schema_mismatch: bool

The server publishes a catalogue from a schema this build does not know, which blocks downloading for this game and nothing else.

§download_started: bool

Set when scene 4b starts its run, since the sheet activates the page again afterwards.

§downloaded: usize

What scene 4b fetched, for the summary, since the install outcome comes later.

§downloaded_bytes: u64§not_downloaded: Vec<NotDownloaded>

What scene 4b could not bring after its retries, which scene 7 names.

§chosen: Vec<String>

The keys committed with Download, in tree order.

§config: Configuration

Rebuilt from the tree each time scene 5 activates.

§points: Vec<Point>

The points offered, newest first; the list’s last row is “remove everything”.

§restore_to: Option<Point>

The chosen point and what it would do, handed to the worker unchanged, so the preview approved and the work done cannot disagree.

§restore_plan: Plan§log: Log

Shown on scenes 6 and 7, and written to disk as it grows.

§cancel: Arc<AtomicBool>

Raised by the UI thread, read by the worker between chunks.

§install_started: bool

Set when scene 6 starts its run, since the sheet activates the page again afterwards.

§outcome: Option<Outcome>

None while the run is still going.

§request: usize

Implementations§

Source§

impl WizardState

Source

pub fn new(base_url: String, cache_override: Option<PathBuf>) -> WizardState

Source

pub fn next_request(&mut self) -> usize

A fresh id for a worker request; answers to older ids are dropped.

Source

pub fn is_current_request(&self, request: usize) -> bool

Source

pub fn token(&self) -> Option<String>

The access key for a request, or None for anonymous.

Source

pub fn resume(&mut self, restart: Restart)

Takes up where an instance restarted as administrator left off: its language, folder and key, the key already past scene 2.

Source

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

Scene 3 settles the game before anything needs it; RBR only spares the lookups a None.

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> 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, 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.