Skip to main content

starla_common/
status.rs

1//! Probe status for tray app communication
2//!
3//! Serialized as JSON over a Unix domain socket (or named pipe on Windows).
4
5use serde::{Deserialize, Serialize};
6use std::collections::HashMap;
7
8/// Current probe status, sent to the tray app on socket connection.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct ProbeStatus {
11    /// Probe ID (0 if not yet registered)
12    pub probe_id: u32,
13    /// Whether connected to the controller
14    pub connected: bool,
15    /// Controller hostname (if connected)
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub controller: Option<String>,
18    /// Seconds since probe started
19    pub uptime_secs: u64,
20    /// Scheduled measurement counts by type
21    pub measurements: HashMap<String, u64>,
22    /// Results waiting in the upload queue
23    pub queue_depth: usize,
24    /// SSH public key (for registration)
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub public_key: Option<String>,
27}