[−][src]Struct procfs::CpuInfo
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]
pub fn num_cores(&self) -> usize
[src]
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]
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 vendor_id(&self, cpu_num: usize) -> Option<&str>
[src]
pub fn physical_id(&self, cpu_num: usize) -> Option<u32>
[src]
pub fn flags(&self, cpu_num: usize) -> Option<Vec<&str>>
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,