Struct procfs::CpuInfo [−][src]
Represents the data from /proc/cpuinfo
.
The fields
field stores the fields that are common among all CPUs. The cpus
field stores
CPU-specific info.
For common fields, there are methods that will return the data, converted to a more appropriate
data type. These methods will all return None
if the field doesn't exist, or is in some
unexpected format (in that case, you'll have to access the string data directly).
Fields
fields: HashMap<String, String>
This stores fields that are common among all CPUs
cpus: Vec<HashMap<String, String>>
Methods
impl CpuInfo
[src]
impl CpuInfo
pub fn num_cores(&self) -> usize
[src]
pub fn num_cores(&self) -> usize
Get the total number of cpu cores.
This is the number of entries in the /proc/cpuinfo
file.
pub fn get_info(&self, cpu_num: usize) -> Option<HashMap<&str, &str>>
[src]
pub fn get_info(&self, cpu_num: usize) -> Option<HashMap<&str, &str>>
Get info for a specific cpu.
This will merge the common fields with the cpu-specific fields.
Returns None if the requested cpu index is not found.
pub fn model_name(&self, cpu_num: usize) -> Option<&str>
[src]
pub fn model_name(&self, cpu_num: usize) -> Option<&str>
pub fn vendor_id(&self, cpu_num: usize) -> Option<&str>
[src]
pub fn vendor_id(&self, cpu_num: usize) -> Option<&str>
pub fn physical_id(&self, cpu_num: usize) -> Option<u32>
[src]
pub fn physical_id(&self, cpu_num: usize) -> Option<u32>
pub fn flags(&self, cpu_num: usize) -> Option<Vec<&str>>
[src]
pub fn flags(&self, cpu_num: usize) -> Option<Vec<&str>>