[][src]Struct ryzen_reader::CpuInfo

pub struct CpuInfo { /* fields omitted */ }

Implementations

impl CpuInfo[src]

Struct that allows reading of cpu power info

Example

    let cpu = CpuInfo::new()?;
    let power = cpu.read()?;

    println!("Package power:");
    for (package, usage) in power.packages().enumerate() {
        println!("\t#{}: {:.2}W", package, usage);
    }
    println!("Core power:");
    for (core, usage) in power.cores().enumerate() {
        println!("\t#{}: {:.2}W", core, usage);
    }

pub fn new() -> Result<Self, Error>[src]

pub fn read(&self) -> Result<CpuPower, Error>[src]

Read the cpu power levels

Note that this method will block for ~10ms

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.