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§
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