pub struct BatteryCounters {
pub charge_counter_uah: Option<i64>,
pub capacity_percent: Option<f32>,
pub current_ua: Option<i64>,
pub current_avg_ua: Option<i64>,
pub name: Option<String>,
pub energy_counter_uwh: Option<i64>,
pub voltage_uv: Option<i64>,
}
Fields§
§charge_counter_uah: Option<i64>
Battery capacity in microampere-hours(µAh). Also known as Coulomb counter.
capacity_percent: Option<f32>
Remaining battery capacity percentage of total capacity
current_ua: Option<i64>
Instantaneous battery current in microamperes(µA). Negative values indicate current being drained from the battery and positive values indicate current feeding the battery from a charge source (USB).
See https://perfetto.dev/docs/data-sources/battery-counters for more info.
current_avg_ua: Option<i64>
Instantaneous battery current in microamperes(µA).
name: Option<String>
Battery name, emitted only on multiple batteries.
energy_counter_uwh: Option<i64>
Battery capacity in microwatt-hours(µWh).
voltage_uv: Option<i64>
Battery voltage in microvolts(µV).
Implementations§
Source§impl BatteryCounters
impl BatteryCounters
Sourcepub fn charge_counter_uah(&self) -> i64
pub fn charge_counter_uah(&self) -> i64
Returns the value of charge_counter_uah
, or the default value if charge_counter_uah
is unset.
Sourcepub fn capacity_percent(&self) -> f32
pub fn capacity_percent(&self) -> f32
Returns the value of capacity_percent
, or the default value if capacity_percent
is unset.
Sourcepub fn current_ua(&self) -> i64
pub fn current_ua(&self) -> i64
Returns the value of current_ua
, or the default value if current_ua
is unset.
Sourcepub fn current_avg_ua(&self) -> i64
pub fn current_avg_ua(&self) -> i64
Returns the value of current_avg_ua
, or the default value if current_avg_ua
is unset.
Sourcepub fn energy_counter_uwh(&self) -> i64
pub fn energy_counter_uwh(&self) -> i64
Returns the value of energy_counter_uwh
, or the default value if energy_counter_uwh
is unset.
Sourcepub fn voltage_uv(&self) -> i64
pub fn voltage_uv(&self) -> i64
Returns the value of voltage_uv
, or the default value if voltage_uv
is unset.
Trait Implementations§
Source§impl Clone for BatteryCounters
impl Clone for BatteryCounters
Source§fn clone(&self) -> BatteryCounters
fn clone(&self) -> BatteryCounters
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BatteryCounters
impl Debug for BatteryCounters
Source§impl Default for BatteryCounters
impl Default for BatteryCounters
Source§impl Message for BatteryCounters
impl Message for BatteryCounters
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.