pub struct Battery {Show 13 fields
pub state_of_charge_pct: Option<f64>,
pub state_of_health_pct: Option<f64>,
pub voltage_v: Option<f64>,
pub current_a: Option<f64>,
pub temperature_c: Option<f64>,
pub capacity_wh: Option<f64>,
pub remaining_wh: Option<f64>,
pub cycle_count: Option<u32>,
pub chemistry: Option<BatteryChemistry>,
pub is_low: Option<bool>,
pub is_critical: Option<bool>,
pub cell_voltages_v: Option<Vec<f64>>,
pub cell_temperatures_c: Option<Vec<f64>>,
}Expand description
Battery status information.
Fields§
§state_of_charge_pct: Option<f64>State of charge percentage (0-100)
state_of_health_pct: Option<f64>State of health percentage (0-100)
voltage_v: Option<f64>Battery voltage in volts
current_a: Option<f64>Battery current in amps (positive = discharging)
temperature_c: Option<f64>Battery temperature in Celsius
capacity_wh: Option<f64>Battery capacity in watt-hours
remaining_wh: Option<f64>Remaining capacity in watt-hours
cycle_count: Option<u32>Cycle count
chemistry: Option<BatteryChemistry>Battery chemistry
is_low: Option<bool>Whether battery is low (threshold-based)
is_critical: Option<bool>Whether battery is critical (threshold-based)
cell_voltages_v: Option<Vec<f64>>Battery cell voltages (if available)
cell_temperatures_c: Option<Vec<f64>>Battery cell temperatures (if available)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Battery
impl<'de> Deserialize<'de> for Battery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Battery
impl RefUnwindSafe for Battery
impl Send for Battery
impl Sync for Battery
impl Unpin for Battery
impl UnwindSafe for Battery
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