system_data/lib.rs
1pub mod cpu_info;
2pub use cpu_info as CpuInfo;
3
4pub mod disk_info;
5pub use disk_info as DiskInfo;
6
7mod sanitize_data;
8
9/// A package for collect information about OS, CPU and Disk Drive of a windows operating system.
10
11/// You can collect disk information from any device with just a function call. you will be able to collect the `OS Information`, `CPU Information` and `Disk Information` information of a windows system with this package.
12///
13
14/// ### Functions
15/// `cores()` for collect the cores information of a CPU.
16///
17/// ### Example
18/// We are printing here the total capacity information about the disk drive of a windows system.
19///
20/// ```
21/// src/main.rs
22/// --------------
23///
24/// pub mod cpu_info;
25/// pub use cpu_info as CpuInfo;
26///
27/// fn main() {
28/// let cores = CpuInfo::cores();
29/// println!("CPU Cores: {}", cores);
30/// }
31/// ```
32
33pub fn read_doc() {
34 let disk_name = DiskInfo::name();
35 let disk_model = DiskInfo::model();
36 let disk_size = DiskInfo::size();
37 let disk_serial_number = DiskInfo::serial_number();
38
39 println!("{:?}", disk_name);
40 println!("{:?}", disk_model);
41 println!("{:?}", disk_size);
42 println!("{:?}", disk_serial_number);
43
44 let cpu_name = CpuInfo::name();
45 let cpu_cores = CpuInfo::cores();
46 let cpu_id = CpuInfo::processor_id();
47
48 println!("{:?}", cpu_name);
49 println!("{:?}", cpu_cores);
50 println!("{:?}", cpu_id);
51}