pub enum PowerError {
SensorUnavailable(String),
SensorRead {
path: String,
reason: String,
},
NonPositiveDuration(f64),
ZeroTokens,
InvalidProfile(String),
}Expand description
Anything that can go wrong while sampling power or computing local-inference economics.
Variants§
The selected power source is not available on this host (e.g. the amdgpu hwmon
power1_average node is absent under WSL2, or the power feature is off). The
runtime selector treats this as “fall through to the next source”, never a crash.
SensorRead
A sensor node existed but could not be read or parsed (I/O error, non-integer microwatt value, transient permission failure).
NonPositiveDuration(f64)
Energy/cost math was asked to divide by a zero (or negative) run duration. A run must have positive wall-clock seconds to integrate power into energy.
ZeroTokens
Per-token economics were requested for a run that produced zero tokens — the
$/token figure is undefined, so the caller must handle it rather than emit ∞/NaN.
InvalidProfile(String)
A hardware/power profile carried a non-physical value (negative price, zero lifetime, utilization outside (0, 1]).
Trait Implementations§
Source§impl Debug for PowerError
impl Debug for PowerError
Source§impl Display for PowerError
impl Display for PowerError
Source§impl Error for PowerError
impl Error for PowerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()