all functions established; needed to remove orphan functions
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user