pub struct CPUInfo {Show 20 fields
pub vendor: CPUVendor,
pub model_name: String,
pub brand: String,
pub physical_cores: u32,
pub logical_cores: u32,
pub base_frequency: u32,
pub max_frequency: u32,
pub l1_cache_kb: u32,
pub l2_cache_kb: u32,
pub l3_cache_kb: u32,
pub features: Vec<CPUFeature>,
pub architecture: String,
pub core_usage: Vec<f32>,
pub temperature: Option<f32>,
pub power_consumption: Option<f32>,
pub stepping: Option<u32>,
pub family: Option<u32>,
pub model: Option<u32>,
pub microcode: Option<String>,
pub vulnerabilities: Vec<String>,
}
Expand description
CPU information and specifications
Fields§
§vendor: CPUVendor
CPU vendor
model_name: String
CPU model name
brand: String
CPU brand string
physical_cores: u32
Number of physical cores
logical_cores: u32
Number of logical cores (threads)
base_frequency: u32
Base frequency in MHz
max_frequency: u32
Maximum frequency in MHz
l1_cache_kb: u32
L1 cache size in KB
l2_cache_kb: u32
L2 cache size in KB
l3_cache_kb: u32
L3 cache size in KB
features: Vec<CPUFeature>
CPU features supported
architecture: String
Architecture (x86_64, arm64, etc.)
core_usage: Vec<f32>
CPU usage percentage per core
temperature: Option<f32>
CPU temperature in Celsius (if available)
power_consumption: Option<f32>
CPU power consumption in watts (if available)
stepping: Option<u32>
CPU stepping
family: Option<u32>
CPU family
model: Option<u32>
CPU model number
microcode: Option<String>
CPU microcode version
vulnerabilities: Vec<String>
CPU vulnerabilities (Spectre, Meltdown, etc.)
Implementations§
Source§impl CPUInfo
impl CPUInfo
Sourcepub fn model_name(&self) -> &str
pub fn model_name(&self) -> &str
Get CPU model name
Sourcepub fn physical_cores(&self) -> u32
pub fn physical_cores(&self) -> u32
Get number of physical cores
Sourcepub fn logical_cores(&self) -> u32
pub fn logical_cores(&self) -> u32
Get number of logical cores (threads)
Sourcepub fn base_frequency(&self) -> u32
pub fn base_frequency(&self) -> u32
Get base frequency in MHz
Sourcepub fn max_frequency(&self) -> u32
pub fn max_frequency(&self) -> u32
Get maximum frequency in MHz
Sourcepub fn l1_cache_kb(&self) -> u32
pub fn l1_cache_kb(&self) -> u32
Get L1 cache size in KB
Sourcepub fn l2_cache_kb(&self) -> u32
pub fn l2_cache_kb(&self) -> u32
Get L2 cache size in KB
Sourcepub fn l3_cache_kb(&self) -> u32
pub fn l3_cache_kb(&self) -> u32
Get L3 cache size in KB
Sourcepub fn features(&self) -> &[CPUFeature]
pub fn features(&self) -> &[CPUFeature]
Get supported CPU features
Sourcepub fn has_feature(&self, feature: &str) -> bool
pub fn has_feature(&self, feature: &str) -> bool
Check if CPU supports a specific feature
Sourcepub fn architecture(&self) -> &str
pub fn architecture(&self) -> &str
Get CPU architecture
Sourcepub fn core_usage(&self) -> &[f32]
pub fn core_usage(&self) -> &[f32]
Get current CPU usage per core
Sourcepub fn temperature(&self) -> Option<f32>
pub fn temperature(&self) -> Option<f32>
Get CPU temperature (if available)
Sourcepub fn power_consumption(&self) -> Option<f32>
pub fn power_consumption(&self) -> Option<f32>
Get CPU power consumption (if available)