pub struct BatteryState {Show 16 fields
pub header: Option<Header>,
pub voltage: f64,
pub temperature: f64,
pub current: f64,
pub charge: f64,
pub capacity: f64,
pub design_capacity: f64,
pub percentage: f64,
pub power_supply_status: i32,
pub power_supply_health: i32,
pub power_supply_technology: i32,
pub present: bool,
pub cell_voltage: Vec<f64>,
pub cell_temperature: Vec<f64>,
pub location: String,
pub serial_number: String,
}
Fields§
§header: Option<Header>
§voltage: f64
Voltage in Volts (Mandatory)
temperature: f64
Temperature in Degrees Celsius (If unmeasured NaN)
current: f64
Negative when discharging (A) (If unmeasured NaN)
charge: f64
Current charge in Ah (If unmeasured NaN)
capacity: f64
Capacity in Ah (last full capacity) (If unmeasured NaN)
design_capacity: f64
Capacity in Ah (design capacity) (If unmeasured NaN)
percentage: f64
Charge percentage on 0 to 1 range (If unmeasured NaN)
power_supply_status: i32
The charging status as reported. Values defined above
power_supply_health: i32
The battery health metric. Values defined above
power_supply_technology: i32
The battery chemistry. Values defined above
present: bool
True if the battery is present
cell_voltage: Vec<f64>
An array of individual cell voltages for each cell in the pack
cell_temperature: Vec<f64>
If individual voltages unknown but number of cells known set each to NaN
An array of individual cell temperatures for each cell in the pack
location: String
If individual temperatures unknown but number of cells known set each to NaN
The location into which the battery is inserted. (slot number or plug)
serial_number: String
The best approximation of the battery serial number
Implementations§
Source§impl BatteryState
impl BatteryState
Sourcepub fn power_supply_status(&self) -> PowerSupplyStatus
pub fn power_supply_status(&self) -> PowerSupplyStatus
Returns the enum value of power_supply_status
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_power_supply_status(&mut self, value: PowerSupplyStatus)
pub fn set_power_supply_status(&mut self, value: PowerSupplyStatus)
Sets power_supply_status
to the provided enum value.
Sourcepub fn power_supply_health(&self) -> PowerSupplyHealth
pub fn power_supply_health(&self) -> PowerSupplyHealth
Returns the enum value of power_supply_health
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_power_supply_health(&mut self, value: PowerSupplyHealth)
pub fn set_power_supply_health(&mut self, value: PowerSupplyHealth)
Sets power_supply_health
to the provided enum value.
Sourcepub fn power_supply_technology(&self) -> PowerSupplyTechnology
pub fn power_supply_technology(&self) -> PowerSupplyTechnology
Returns the enum value of power_supply_technology
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_power_supply_technology(&mut self, value: PowerSupplyTechnology)
pub fn set_power_supply_technology(&mut self, value: PowerSupplyTechnology)
Sets power_supply_technology
to the provided enum value.
Trait Implementations§
Source§impl Clone for BatteryState
impl Clone for BatteryState
Source§fn clone(&self) -> BatteryState
fn clone(&self) -> BatteryState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BatteryState
impl Debug for BatteryState
Source§impl Default for BatteryState
impl Default for BatteryState
Source§impl Message for BatteryState
impl Message for BatteryState
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.