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
impl Installer
pub fn new(config: ModuleConfig) -> Self
Sourcepub fn with_context(config: ModuleConfig, ctx: EvalContext) -> Self
pub fn with_context(config: ModuleConfig, ctx: EvalContext) -> Self
Create an installer with pre-populated game environment context.
pub fn context(&self) -> &EvalContext
pub fn context_mut(&mut self) -> &mut EvalContext
pub fn config(&self) -> &ModuleConfig
Sourcepub fn check_dependencies(&self) -> bool
pub fn check_dependencies(&self) -> bool
Check module-level dependencies. Returns true if satisfied.
Sourcepub fn visible_steps(&self) -> Vec<(usize, &InstallStep)>
pub fn visible_steps(&self) -> Vec<(usize, &InstallStep)>
Get visible install steps (steps whose visibility conditions are met).
Sourcepub fn select(
&mut self,
step_index: usize,
group_index: usize,
plugin_indices: Vec<usize>,
)
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.
Sourcepub fn default_selections_in_context(
group: &Group,
ctx: &EvalContext,
) -> Vec<usize>
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.
Sourcepub fn default_selections(group: &Group) -> Vec<usize>
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.
Sourcepub fn validate_selection(
group: &Group,
selected: &[usize],
) -> Result<(), SelectionError>
pub fn validate_selection( group: &Group, selected: &[usize], ) -> Result<(), SelectionError>
Validate selections against group type constraints.
Sourcepub fn resolve(&self) -> InstallPlan
pub fn resolve(&self) -> InstallPlan
Resolve the final installation plan from all selections.
Sourcepub fn group_name(&self, step: usize, group: usize) -> Option<&str>
pub fn group_name(&self, step: usize, group: usize) -> Option<&str>
Get the name of a group within a step.
Sourcepub fn plugin_description(
&self,
step: usize,
group: usize,
plugin: usize,
) -> Option<&str>
pub fn plugin_description( &self, step: usize, group: usize, plugin: usize, ) -> Option<&str>
Get a plugin’s description text.
Sourcepub fn plugin_image_path(
&self,
step: usize,
group: usize,
plugin: usize,
) -> Option<&str>
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).
Sourcepub fn module_image_path(&self) -> Option<&str>
pub fn module_image_path(&self) -> Option<&str>
Get the module header image path.
Sourcepub fn plugin_type_at(
&self,
step: usize,
group: usize,
plugin: usize,
) -> Option<PluginType>
pub fn plugin_type_at( &self, step: usize, group: usize, plugin: usize, ) -> Option<PluginType>
Get the resolved plugin type in the current context.
Sourcepub fn group_type_at(&self, step: usize, group: usize) -> Option<GroupType>
pub fn group_type_at(&self, step: usize, group: usize) -> Option<GroupType>
Get the group type for a specific group.
Sourcepub fn resolve_image(
&self,
base_path: &Path,
image_path: &str,
) -> Option<PathBuf>
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.
Sourcepub fn preview_plugin(
&self,
step: usize,
group: usize,
plugin: usize,
) -> Vec<FileOperation>
pub fn preview_plugin( &self, step: usize, group: usize, plugin: usize, ) -> Vec<FileOperation>
Preview the file operations a specific plugin would contribute.
Sourcepub fn preview_current(&self) -> InstallPlan
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.
Sourcepub fn completion_status(&self) -> CompletionStatus
pub fn completion_status(&self) -> CompletionStatus
Get overall completion status of the wizard.
Sourcepub fn is_ready_to_install(&self) -> bool
pub fn is_ready_to_install(&self) -> bool
Check if all required groups have valid selections and installation can proceed.
Sourcepub fn missing_selections(&self) -> Vec<(usize, usize)>
pub fn missing_selections(&self) -> Vec<(usize, usize)>
Return (step_idx, group_idx) pairs for groups that still need user input.
Sourcepub fn validate_step(&self, step_index: usize) -> Vec<ValidationHint>
pub fn validate_step(&self, step_index: usize) -> Vec<ValidationHint>
Validate all groups in a step and return detailed hints for the UI.
Sourcepub fn detect_conflicts(&self) -> Vec<FileConflict>
pub fn detect_conflicts(&self) -> Vec<FileConflict>
Detect file conflicts: plugins that install to the same destination path.
Sourcepub fn flag_impact_map(&self) -> Vec<FlagImpact>
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”.
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Save a snapshot of current selections and context for later rollback.
Sourcepub fn rollback(&mut self) -> bool
pub fn rollback(&mut self) -> bool
Rollback to the most recent checkpoint. Returns false if no history.
Sourcepub fn history_len(&self) -> usize
pub fn history_len(&self) -> usize
Number of available undo checkpoints.