bijux_cli/features/install/
query.rs1#![forbid(unsafe_code)]
2use super::diagnostics::install_health_report;
5
6#[derive(Debug, Clone, PartialEq, Eq)]
8#[allow(clippy::struct_excessive_bools)]
9pub struct RuntimeIdentityQuery {
10 pub active_binary: Option<String>,
12 pub path_binaries: Vec<String>,
14 pub has_path_shadowing: bool,
16 pub has_duplicate_installs: bool,
18 pub stale_wrapper_scripts: Vec<String>,
20 pub has_mismatched_wheel_binary_versions: bool,
22 pub legacy_installer_conflicts: Vec<String>,
24 pub active_binary_missing: bool,
26 pub broken_symlink_active_binary: bool,
28}
29
30impl RuntimeIdentityQuery {
31 #[must_use]
33 pub fn stale_wrapper_maintenance(&self) -> Vec<String> {
34 self.stale_wrapper_scripts.clone()
35 }
36}
37
38#[must_use]
40pub fn runtime_identity_query(
41 path_value: &str,
42 bin_override: Option<&str>,
43 wheel_version: Option<&str>,
44 runtime_version: &str,
45) -> RuntimeIdentityQuery {
46 let report = install_health_report(path_value, bin_override, wheel_version, runtime_version);
47 RuntimeIdentityQuery {
48 active_binary: report.active_binary,
49 path_binaries: report.path_binaries,
50 has_path_shadowing: report.has_path_shadowing,
51 has_duplicate_installs: report.has_duplicate_installs,
52 stale_wrapper_scripts: report.stale_wrapper_scripts,
53 has_mismatched_wheel_binary_versions: report.has_mismatched_wheel_binary_versions,
54 legacy_installer_conflicts: report.legacy_installer_conflicts,
55 active_binary_missing: report.active_binary_missing,
56 broken_symlink_active_binary: report.broken_symlink_active_binary,
57 }
58}