Skip to main content

BatteryReader

Trait BatteryReader 

Source
pub trait BatteryReader: Send + Sync {
    // Required method
    fn read(&self) -> Result<BatteryReading, BatteryError>;
}
Expand description

Abstraction over battery hardware.

Implement this trait to provide battery readings from a real or simulated source. Implementations must be Send + Sync so they can be shared across threads without restriction.

Required Methods§

Source

fn read(&self) -> Result<BatteryReading, BatteryError>

Read the current battery state.

Implementors§