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
pub use system::{Features, System};
pub mod platform;
mod system;
pub type Pid = u32;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Feature {0} missing")]
FeatureMissing(Features),
#[cfg(target_os = "macos")]
#[error(transparent)]
Smc(#[from] smc::SMCError),
#[error("Can't get physical core count")]
PhysicalCoreCount,
#[cfg(target_os = "windows")]
#[error(transparent)]
Wmi(#[from] wmi::WMIError),
#[cfg(target_os = "windows")]
#[error("Can't get com library")]
ComLib,
#[cfg(target_os = "windows")]
#[error("PDH_STATUS({})", 0.0)]
Pdh(windows::Win32::Foundation::WIN32_ERROR),
#[cfg(target_os = "windows")]
#[error("Can't open process handle")]
ProcessHandle,
#[cfg(target_os = "windows")]
#[error("WinError: {0}")]
WinError(#[from] windows::core::Error),
#[error("Access denied")]
AccessDenied,
#[error("Etw error")]
Etw,
#[error("Unsupported features: {0}")]
UnsupportedFeatures(Features),
}
#[derive(Copy, Clone)]
pub enum GpuCalculation {
Max,
Sum,
}
impl Default for GpuCalculation {
fn default() -> Self {
Self::Max
}
}