pub struct CpuInfo(/* private fields */);
Expand description
Information about /proc/cpuinfo.
Implementations§
Source§impl CpuInfo
impl CpuInfo
Sourcepub fn read() -> Result<Self, Error>
pub fn read() -> Result<Self, Error>
Read 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>
Read CPU information from the given file.
§Errors
Returns an std::io::Error
if the file could not be read
Sourcepub fn cpu(&self, index: usize) -> Option<Cpu<'_>>
pub fn cpu(&self, index: usize) -> Option<Cpu<'_>>
Return the CPU at the given index if it exists.
Trait Implementations§
impl Eq for CpuInfo
impl StructuralPartialEq for CpuInfo
Auto Trait Implementations§
impl Freeze for CpuInfo
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