pub struct CpuInfo {
pub vendor: String,
pub brand: String,
pub codename: String,
pub num_cores: i32,
pub num_logical_cpus: i32,
pub total_logical_cpus: i32,
pub l1_data_cache: Option<i32>,
pub l1_instruction_cache: Option<i32>,
pub l2_cache: Option<i32>,
pub l3_cache: Option<i32>,
/* private fields */
}Expand description
A struct holding information about CPU features.
This data structure is returned by identify(). You can consult
libcpuid docs for cpu_id_t
for more detailed descriptions of these fields.
Fields§
§vendor: StringCPU vendor string, for example GenuineIntel.
brand: StringBrand string, for example Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz.
codename: StringBrief CPU codename, such as Sandy Bridge (Core i5).
num_cores: i32Number of physical cores of the current CPU.
num_logical_cpus: i32Number of logical processors (may include HyperThreading or such).
total_logical_cpus: i32Total number of logical processors.
l1_data_cache: Option<i32>L1 data cache size in kB. Some(0) if the CPU lacks cache, None if it couldn’t be determined.
l1_instruction_cache: Option<i32>L1 instruction cache size in kB. Some(0) if the CPU lacks cache, None if it couldn’t be determined.
l2_cache: Option<i32>L2 cache size in kB. Some(0) if the CPU lacks L2 cache, None if it couldn’t be determined.
l3_cache: Option<i32>L3 cache size in kB. Some(0) if the CPU lacks L3 cache, None if it couldn’t be determined.
Implementations§
Source§impl CpuInfo
impl CpuInfo
Sourcepub fn has_feature(&self, feature: CpuFeature) -> bool
pub fn has_feature(&self, feature: CpuFeature) -> bool
Checks if current CPU supports given feature.
See CpuFeature for a list of available feature identifiers.