all functions established; needed to remove orphan functions

This commit is contained in:
2025-08-08 23:28:05 +02:00
parent abfa0b6fc0
commit 93a40fe584
6 changed files with 22 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ mod cpu;
mod disk;
mod gpu;
mod memory;
mod network;
pub(crate) mod network;
pub use cpu::get_cpu_info;
pub use disk::get_disk_info;
@@ -20,16 +20,19 @@ pub struct HardwareInfo {
pub memory: memory::MemoryInfo,
pub disk: disk::DiskInfo,
pub network: network::NetworkInfo,
network_monitor: network::NetworkMonitor,
}
impl HardwareInfo {
pub async fn collect() -> anyhow::Result<Self, Box<dyn Error>> {
let mut network_monitor = network::NetworkMonitor::new();
Ok(Self {
cpu: get_cpu_info().await?,
gpu: get_gpu_info().await?,
memory: get_memory_info().await?,
disk: get_disk_info().await?,
network: get_network_info().await?,
network: get_network_info(&mut network_monitor).await?,
network_monitor,
})
}
}