#![forbid(unsafe_code)]
use super::diagnostics::install_health_report;
#[derive(Debug, Clone, PartialEq, Eq)]
#[allow(clippy::struct_excessive_bools)]
pub struct RuntimeIdentityQuery {
pub active_binary: Option<String>,
pub path_binaries: Vec<String>,
pub has_path_shadowing: bool,
pub has_duplicate_installs: bool,
pub stale_wrapper_scripts: Vec<String>,
pub has_mismatched_wheel_binary_versions: bool,
pub legacy_installer_conflicts: Vec<String>,
pub active_binary_missing: bool,
pub broken_symlink_active_binary: bool,
}
impl RuntimeIdentityQuery {
#[must_use]
pub fn stale_wrapper_maintenance(&self) -> Vec<String> {
self.stale_wrapper_scripts.clone()
}
}
#[must_use]
pub fn runtime_identity_query(
path_value: &str,
bin_override: Option<&str>,
wheel_version: Option<&str>,
runtime_version: &str,
) -> RuntimeIdentityQuery {
let report = install_health_report(path_value, bin_override, wheel_version, runtime_version);
RuntimeIdentityQuery {
active_binary: report.active_binary,
path_binaries: report.path_binaries,
has_path_shadowing: report.has_path_shadowing,
has_duplicate_installs: report.has_duplicate_installs,
stale_wrapper_scripts: report.stale_wrapper_scripts,
has_mismatched_wheel_binary_versions: report.has_mismatched_wheel_binary_versions,
legacy_installer_conflicts: report.legacy_installer_conflicts,
active_binary_missing: report.active_binary_missing,
broken_symlink_active_binary: report.broken_symlink_active_binary,
}
}