1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
//! # Hardware Query
//!
//! **The easiest way to get hardware information in Rust.**
//!
//! This crate provides a simple, cross-platform API for hardware detection and system monitoring.
//! Whether you need a quick system overview or detailed hardware analysis, there's an API tier for you.
//!
//! ## Quick Start (1 line of code)
//!
//! Get a complete system overview with health status:
//!
//! ```rust
//! use hardware_query::SystemOverview;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let overview = SystemOverview::quick()?;
//! println!("{}", overview); // Formatted system summary with health status
//! # Ok(())
//! # }
//! ```
//!
//! ## Domain-Specific Presets (2-3 lines)
//!
//! Get assessments tailored to your use case:
//!
//! ```rust
//! use hardware_query::HardwarePresets;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // For AI/ML applications
//! let ai_assessment = HardwarePresets::ai_assessment()?;
//! println!("AI Score: {}/100", ai_assessment.ai_score);
//! println!("Supported Frameworks: {:?}", ai_assessment.frameworks);
//!
//! // For gaming applications
//! let gaming_assessment = HardwarePresets::gaming_assessment()?;
//! println!("Gaming Score: {}/100", gaming_assessment.gaming_score);
//! println!("Recommended Settings: {}", gaming_assessment.recommended_settings);
//!
//! // For development environments
//! let dev_assessment = HardwarePresets::developer_assessment()?;
//! println!("Build Performance: {:?}", dev_assessment.build_performance);
//! # Ok(())
//! # }
//! ```
//!
//! ## Custom Queries (3-5 lines)
//!
//! Build exactly the hardware query you need:
//!
//! ```rust
//! use hardware_query::HardwareQueryBuilder;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Get basic system info
//! let basic_info = HardwareQueryBuilder::new()
//! .with_basic()
//! .cpu_and_memory()?;
//!
//! // Get AI-focused hardware info
//! let ai_info = HardwareQueryBuilder::new()
//! .with_ai_focused()
//! .gpu_and_accelerators()?;
//!
//! // Get everything for system monitoring
//! let monitoring_info = HardwareQueryBuilder::new()
//! .with_monitoring()
//! .all_hardware()?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Complete Hardware Analysis (Advanced)
//!
//! For detailed hardware analysis and custom processing:
//!
//! ```rust
//! use hardware_query::HardwareInfo;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Get complete system information
//! let hw_info = HardwareInfo::query()?;
//!
//! // Access detailed CPU information
//! let cpu = hw_info.cpu();
//! println!("CPU: {} {} - {} cores, {} threads",
//! cpu.vendor(),
//! cpu.model_name(),
//! cpu.physical_cores(),
//! cpu.logical_cores()
//! );
//!
//! // Check specific CPU features for optimization
//! if cpu.has_feature("avx2") && cpu.has_feature("fma") {
//! println!("CPU optimized for SIMD operations");
//! }
//!
//! // Analyze GPU capabilities for AI workloads
//! for gpu in hw_info.gpus() {
//! println!("GPU: {} {} - {} GB VRAM",
//! gpu.vendor(), gpu.model_name(), gpu.memory_gb());
//!
//! if gpu.supports_cuda() {
//! println!(" CUDA support available");
//! }
//! if gpu.supports_opencl() {
//! println!(" OpenCL support available");
//! }
//! }
//!
//! // Check for specialized AI hardware
//! if !hw_info.npus().is_empty() {
//! println!("AI accelerators found: {} NPUs", hw_info.npus().len());
//! }
//!
//! // Memory analysis for performance optimization
//! let memory = hw_info.memory();
//! println!("Memory: {} GB total, {} GB available",
//! memory.total_gb(),
//! memory.available_gb()
//! );
//!
//! // Storage performance characteristics
//! for storage in hw_info.storage() {
//! println!("Storage: {} - {} GB ({})",
//! storage.model(),
//! storage.capacity_gb(),
//! if storage.is_ssd() { "SSD" } else { "HDD" }
//! );
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Monitoring and Real-time Updates
//!
//! For applications that need continuous hardware monitoring:
//!
//! ```rust,no_run
//! #[cfg(feature = "monitoring")]
//! use hardware_query::{HardwareMonitor, MonitoringConfig};
//!
//! # #[cfg(feature = "monitoring")]
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = MonitoringConfig::new()
//! .with_cpu_monitoring(true)
//! .with_thermal_monitoring(true)
//! .with_interval_ms(1000);
//!
//! let mut monitor = HardwareMonitor::new(config);
//!
//! monitor.start_monitoring(|event| {
//! match event {
//! hardware_query::MonitoringEvent::TemperatureAlert { component, temp } => {
//! println!("Warning: {} temperature: {}°C", component, temp);
//! }
//! hardware_query::MonitoringEvent::CpuUsageHigh { usage } => {
//! println!("High CPU usage: {}%", usage);
//! }
//! _ => {}
//! }
//! })?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! - **Default**: Basic hardware detection (CPU, Memory, GPU, Storage)
//! - **`monitoring`**: Real-time monitoring capabilities, thermal sensors, power management
//! - **`serde`**: Serialization/deserialization support (automatically enabled)
//!
//! ## Platform Support
//!
//! - **Windows**: Native WMI and Windows API support
//! - **Linux**: Comprehensive `/proc`, `/sys` filesystem support
//! - **macOS**: IOKit and system framework integration
//!
//! All APIs work consistently across platforms, with graceful degradation when specific hardware isn't available.
// Simplified API modules
pub use ;
pub use ;
pub use ;
pub use ;
pub use HardwareInfo;
pub use ;
pub use ;
pub use ;
pub use PCIDevice;
pub use ;
pub use ;
pub use ;
pub use USBDevice;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Simplified API exports - these are the recommended entry points for most users
pub use ;
pub use ;
pub use ;