#[non_exhaustive]pub struct InstallTarget {
pub dir: PathBuf,
pub base: PathBuf,
pub game_dir: PathBuf,
pub game: String,
pub profile: Option<String>,
}Expand description
Where this invocation installs, tracks, and launches from.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dir: PathBufThe install root. The record and its _state directory live here.
base: PathBufThe base holding <game>/{cache,exports,profiles}.
game_dir: PathBufThe game root. Known in both modes: profile mode still needs it for pre-launch staging and executable resolution.
game: StringThe ecosystem game key.
profile: Option<String>Some(name) in profile mode, None in game-directory mode.
Implementations§
Source§impl InstallTarget
impl InstallTarget
Sourcepub fn resolve(
base: PathBuf,
game_dir: PathBuf,
game: &str,
profile: Option<&str>,
) -> Result<Self>
pub fn resolve( base: PathBuf, game_dir: PathBuf, game: &str, profile: Option<&str>, ) -> Result<Self>
Resolves the install root, erroring rather than creating a profile directory that does not exist yet.
Classifies a profile name through layout::require_profile, the same
gate layout::use_profile uses, so selecting a bad name and resolving
one cannot refuse differently. The reason reaches a caller intact as
Error::BadProfile, so wording the
refusal does not mean re-checking the name.
Sourcepub fn exports_dir(&self) -> PathBuf
pub fn exports_dir(&self) -> PathBuf
Where .r2z exports are written.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The name used wherever a profile name is required: the active profile, or
default in game-directory mode.
Sourcepub fn needs_staging(&self) -> bool
pub fn needs_staging(&self) -> bool
Whether pre-launch staging has anywhere to copy to.
False when the install root is the game directory, where every root file already sits at its staging destination. Staging detects a same-file destination itself, so this is a second line of defence and a way to skip a pointless directory walk in the common case.
Also load-bearing when the game directory does not exist yet:
crate::profile::launch::stage_for_launch_in does not detect that case
itself and returns the read_dir error from listing a missing directory
rather than an empty list, so a caller should check this first rather
than call staging unconditionally.