Trait energy_monitor::EnergyMonitor
[−]
[src]
pub trait EnergyMonitor { fn read_uj(&self) -> Result<u64, &'static str>; fn source(&self) -> String; fn interval_us(&self) -> u64; fn precision_uj(&self) -> u64; fn is_exclusive(&self) -> bool; }
An energy monitor typically reads from an internal or external sensor. It could also estimate energy consumption using hardware counters or other heuristics.
Required Methods
fn read_uj(&self) -> Result<u64, &'static str>
Read the energy value in microjoules
fn source(&self) -> String
Get the energy monitoring source as a String
fn interval_us(&self) -> u64
Get the energy monitor's refresh interval in microseconds. This can be used as a minimum polling period.
fn precision_uj(&self) -> u64
Get the energy monitor's precision in microjoules.
fn is_exclusive(&self) -> bool
Get whether energy monitor requires exclusive access.
Implementors
impl EnergyMonitor for DummyEnergyMonitor