Skip to main content

Installer

Struct Installer 

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

Drives the FOMOD installation process.

Tracks user selections and condition flags, then resolves the final set of file operations.

Implementations§

Source§

impl Installer

Source

pub fn new(config: ModuleConfig) -> Self

Source

pub fn with_context(config: ModuleConfig, ctx: EvalContext) -> Self

Create an installer with pre-populated game environment context.

Source

pub fn context(&self) -> &EvalContext

Source

pub fn context_mut(&mut self) -> &mut EvalContext

Source

pub fn config(&self) -> &ModuleConfig

Source

pub fn check_dependencies(&self) -> bool

Check module-level dependencies. Returns true if satisfied.

Source

pub fn visible_steps(&self) -> Vec<(usize, &InstallStep)>

Get visible install steps (steps whose visibility conditions are met).

Source

pub fn select( &mut self, step_index: usize, group_index: usize, plugin_indices: Vec<usize>, )

Record user selections for a group within a step.

plugin_indices are indices into the group’s plugin list.

Source

pub fn default_selections_in_context( group: &Group, ctx: &EvalContext, ) -> Vec<usize>

Get the default selections for a group based on context-aware plugin types.

Evaluates dependencyType patterns against the provided context to determine actual plugin types at runtime.

Source

pub fn default_selections(group: &Group) -> Vec<usize>

Get the default selections for a group based on static plugin types.

For dependencyType descriptors, uses the default type without evaluating conditions. Suitable for template generation.

Source

pub fn validate_selection( group: &Group, selected: &[usize], ) -> Result<(), SelectionError>

Validate selections against group type constraints.

Source

pub fn resolve(&self) -> InstallPlan

Resolve the final installation plan from all selections.

Source

pub fn step_name(&self, step: usize) -> Option<&str>

Get the name of a step by index.

Source

pub fn group_name(&self, step: usize, group: usize) -> Option<&str>

Get the name of a group within a step.

Source

pub fn plugin_description( &self, step: usize, group: usize, plugin: usize, ) -> Option<&str>

Get a plugin’s description text.

Source

pub fn plugin_image_path( &self, step: usize, group: usize, plugin: usize, ) -> Option<&str>

Get a plugin’s image path (relative to the mod archive root).

Source

pub fn module_image_path(&self) -> Option<&str>

Get the module header image path.

Source

pub fn plugin_type_at( &self, step: usize, group: usize, plugin: usize, ) -> Option<PluginType>

Get the resolved plugin type in the current context.

Source

pub fn group_type_at(&self, step: usize, group: usize) -> Option<GroupType>

Get the group type for a specific group.

Source

pub fn resolve_image( &self, base_path: &Path, image_path: &str, ) -> Option<PathBuf>

Resolve an image path from the FOMOD XML against the mod archive root.

Performs case-insensitive file lookup since FOMOD is Windows-centric and paths may not match the actual filesystem case on Linux.

Source

pub fn preview_plugin( &self, step: usize, group: usize, plugin: usize, ) -> Vec<FileOperation>

Preview the file operations a specific plugin would contribute.

Source

pub fn preview_current(&self) -> InstallPlan

Preview the install plan based on current selections (without conditional file installs).

This gives a “what you’ve chosen so far” view, useful for showing running totals during the wizard.

Source

pub fn completion_status(&self) -> CompletionStatus

Get overall completion status of the wizard.

Source

pub fn is_ready_to_install(&self) -> bool

Check if all required groups have valid selections and installation can proceed.

Source

pub fn missing_selections(&self) -> Vec<(usize, usize)>

Return (step_idx, group_idx) pairs for groups that still need user input.

Source

pub fn validate_step(&self, step_index: usize) -> Vec<ValidationHint>

Validate all groups in a step and return detailed hints for the UI.

Source

pub fn detect_conflicts(&self) -> Vec<FileConflict>

Detect file conflicts: plugins that install to the same destination path.

Source

pub fn flag_impact_map(&self) -> Vec<FlagImpact>

Build a map of which plugins set flags that affect other steps’ visibility.

Returns a list of impacts: “selecting plugin X may show/hide step Y”.

Source

pub fn checkpoint(&mut self)

Save a snapshot of current selections and context for later rollback.

Source

pub fn rollback(&mut self) -> bool

Rollback to the most recent checkpoint. Returns false if no history.

Source

pub fn history_len(&self) -> usize

Number of available undo checkpoints.

Source

pub fn selections(&self) -> &HashMap<(usize, usize), Vec<usize>>

Get current selections (read-only).

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