Skip to main content

euv_cli/dx/doctor/
struct.rs

1use super::*;
2
3/// Readiness report for one external CLI tool or SDK environment variable.
4#[derive(Clone, Debug, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
5pub struct ToolProbeEntry {
6    /// Executable or SDK environment variable name.
7    pub(crate) name: String,
8    /// Logical toolchain category (`rust`, `web`, `android`, `apple`, `harmony`, `dx`).
9    pub(crate) category: String,
10    /// Whether the tool or SDK was detected on this host.
11    #[get(type(copy))]
12    pub(crate) available: bool,
13    /// Detected version string, SDK path, or `"missing"`.
14    pub(crate) detail: String,
15    /// Targets or workflows requiring this tool.
16    pub(crate) required_for: String,
17    /// Actionable install command or setup hint when missing.
18    pub(crate) install_hint: String,
19}
20
21/// Outcome of one automated `rustup target add` action executed by `euv doctor --fix`.
22#[derive(Clone, Debug, Deserialize, Eq, Getter, New, PartialEq, Serialize)]
23pub struct DoctorFixResult {
24    /// Rust target triple targeted for installation.
25    pub(crate) triple: String,
26    /// Full command string executed.
27    pub(crate) command: String,
28    /// Whether `rustup target add` exited successfully.
29    #[get(type(copy))]
30    pub(crate) succeeded: bool,
31    /// Status message or stderr summary.
32    pub(crate) message: String,
33}
34
35/// Comprehensive environment and 38-target readiness report produced by the upgraded `euv doctor`.
36#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
37pub struct FullDoctorReport {
38    /// Host operating system (`macos`, `linux`, `windows`).
39    pub(crate) host_os: String,
40    /// Host CPU architecture (`aarch64`, `x86_64`, etc.).
41    pub(crate) host_arch: String,
42    /// Probed Rust, Web, Android, Apple, HarmonyOS, and DX tool inventory.
43    pub(crate) tools: Vec<ToolProbeEntry>,
44    /// Per-target readiness across all 38 concrete euv targets.
45    pub(crate) targets: Vec<TargetCapability>,
46    /// Count of concrete targets immediately buildable on this host.
47    #[get(type(copy))]
48    pub(crate) ready_target_count: usize,
49    /// Total concrete targets audited (`38`).
50    #[get(type(copy))]
51    pub(crate) total_target_count: usize,
52    /// Results of any `--fix` `rustup target add` actions performed.
53    #[new(skip)]
54    pub(crate) fix_actions: Vec<DoctorFixResult>,
55}