Struct proc_cpuinfo::CpuInfo
source · pub struct CpuInfo { /* private fields */ }
Implementations§
source§impl CpuInfo
impl CpuInfo
sourcepub fn read() -> Result<Self, Error>
pub fn read() -> Result<Self, Error>
Reads CPU information from /proc/cpuinfo
.
Errors
Returns an std::io::Error
if the file could not be read
sourcepub fn read_from(filename: impl AsRef<Path>) -> Result<Self, Error>
pub fn read_from(filename: impl AsRef<Path>) -> Result<Self, Error>
Reads CPU information from the given file.
Errors
Returns an std::io::Error
if the file could not be read
pub fn cpu(&self, index: usize) -> Option<Cpu<'_>>
pub fn cpus(&self) -> impl Iterator<Item = Cpu<'_>>
pub fn iter(&self) -> impl Iterator<Item = Cpu<'_>>
Trait Implementations§
source§impl PartialEq<CpuInfo> for CpuInfo
impl PartialEq<CpuInfo> for CpuInfo
impl Eq for CpuInfo
impl StructuralEq for CpuInfo
impl StructuralPartialEq for CpuInfo
Auto Trait Implementations§
impl RefUnwindSafe for CpuInfo
impl Send for CpuInfo
impl Sync for CpuInfo
impl Unpin for CpuInfo
impl UnwindSafe for CpuInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more