pub struct InstallProbe {
pub analyze: Box<dyn Fn(&Path) -> Option<InstallMethod> + Send + Sync>,
pub recognizes_bare: Box<dyn Fn(&Path) -> bool + Send + Sync>,
pub user_config_target: Option<&'static str>,
}Expand description
Callbacks the analyzer uses to delegate to a game plugin.
Both hooks have sensible defaults (InstallProbe::noop), so a game
plugin with no special layouts can just leave them unimplemented.
Fields§
§analyze: Box<dyn Fn(&Path) -> Option<InstallMethod> + Send + Sync>Return a game-specific InstallMethod if the plugin recognizes
the extracted archive authoritatively (e.g. Cyberpunk identifying
a REDmod by info.json + archives/ presence). Runs before
the generic probes so it can claim layouts that also happen to
trigger generic heuristics.
recognizes_bare: Box<dyn Fn(&Path) -> bool + Send + Sync>Return true if the extracted archive looks like a bare-extract
for this game (e.g. top-level Data/ for Bethesda). Runs as the
last fallback before InstallMethod::Unknown.
user_config_target: Option<&'static str>Plugin-supplied id of a DeployTargetKind::UserConfig root, if
this game advertises one. The analyzer falls back to a
InstallMethod::UserConfigOverlay keyed on this id when the
archive contains only config-shaped files. None means the
game has no user-config target — config-only archives will go
straight to Unknown.
Implementations§
Source§impl InstallProbe
impl InstallProbe
Sourcepub fn with_user_config_target(self, target_id: &'static str) -> Self
pub fn with_user_config_target(self, target_id: &'static str) -> Self
Builder: attach a user-config target id. The analyzer will
route config-only archives to UserConfigOverlay { target_id }.
Auto Trait Implementations§
impl !RefUnwindSafe for InstallProbe
impl !UnwindSafe for InstallProbe
impl Freeze for InstallProbe
impl Send for InstallProbe
impl Sync for InstallProbe
impl Unpin for InstallProbe
impl UnsafeUnpin for InstallProbe
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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