Struct cpuid::CpuInfo [] [src]

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>,
    // some fields omitted
}

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: String

CPU vendor string, for example GenuineIntel.

brand: String

Brand string, for example Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz.

codename: String

Brief CPU codename, such as Sandy Bridge (Core i5).

num_cores: i32

Number of physical cores of the current CPU.

num_logical_cpus: i32

Number of logical processors (may include HyperThreading or such).

total_logical_cpus: i32

Total 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.

Methods

impl CpuInfo
[src]

fn has_feature(&self, feature: CpuFeature) -> bool

Checks if current CPU supports given feature.

See CpuFeature for a list of available feature identifiers.