use serde::{Serialize, Deserialize};
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct DiskUsage {
pub name: String,
pub used: u64,
pub total: u64,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Process {
pub pid: i32,
pub cpu: f64,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicsProcessUtilization {
pub pid: u32,
pub gpu: u32,
pub memory: u32,
pub encoder: u32,
pub decoder: u32
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicsUsage {
pub id: String,
pub memory_usage: u32,
pub memory_used: u64,
pub encoder: u32,
pub decoder: u32,
pub gpu: u32,
pub temperature: u32,
pub processes: Vec<GraphicsProcessUtilization>
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SystemStatus {
pub memory: i32,
pub cpu: i32,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SystemInfo {
pub os_name: String,
pub kernel_version: String,
pub os_version: String,
pub hostname: String,
pub distribution: String,
pub memory: u64,
pub processor: Processor,
pub total_processors: usize,
pub graphics: Vec<GraphicCard>,
pub disks: Vec<Disk>,
pub cameras: Vec<Camera>,
pub nvidia: Option<NvidiaInfo>,
pub vaapi: bool,
pub model: Option<String>
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Processor {
pub frequency: u64,
pub vendor: String,
pub brand: String
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GraphicCard {
pub id: String,
pub name: String,
pub brand: String,
pub memory: u64,
pub temperature: u32
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Disk {
pub name: String,
pub fs: String,
pub storage_type: String,
pub mount_point: String,
pub available: u64,
pub size: u64
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Camera {
pub name: String,
pub path: String
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NvidiaInfo {
pub driver_version: String,
pub nvml_version: String,
pub cuda_version: i32,
}