Struct BatteryInfo
pub struct BatteryInfo {Show 15 fields
pub status: Option<BatteryStatus>,
pub charge_status: Option<ChargeStatus>,
pub charge_source: Option<ChargeSource>,
pub level_percent: Option<f32>,
pub level_status: Option<LevelStatus>,
pub health: Option<HealthStatus>,
pub time_remaining: Option<TimeRemaining>,
pub timestamp: Option<i64>,
pub present_voltage_mv: Option<u32>,
pub remaining_capacity_uah: Option<u32>,
pub battery_spec: Option<BatterySpec>,
pub full_capacity_uah: Option<i32>,
pub temperature_mc: Option<i32>,
pub present_current_ma: Option<i32>,
pub average_current_ma: Option<i32>,
/* private fields */
}
Expand description
Current battery state information.
Fields§
§status: Option<BatteryStatus>
General battery status with respect to presence & availability.
charge_status: Option<ChargeStatus>
The current state of the battery with respect to charging.
charge_source: Option<ChargeSource>
The charge source while battery is actively charging. When not actively charging, this will reflect that the source is NONE (not charging) or UNKNOWN.
level_percent: Option<f32>
Battery level in percentage. Level percent is only available if level status is known.
level_status: Option<LevelStatus>
Battery level as a general status, including low and critical.
health: Option<HealthStatus>
Overall battery health.
time_remaining: Option<TimeRemaining>
Time remaining relative to the current charge status.
timestamp: Option<i64>
Timestamp to distinguish between latest and stale status.
present_voltage_mv: Option<u32>
Forward the voltage level in mv.
remaining_capacity_uah: Option<u32>
Forward the battery capqacity in uAh.
battery_spec: Option<BatterySpec>
Battery spec.
full_capacity_uah: Option<i32>
Full Charge Capacity in uAh.
temperature_mc: Option<i32>
Temperature in MilliCelsius.
present_current_ma: Option<i32>
Current in MilliAmps.
average_current_ma: Option<i32>
Average Current in MilliAmps.
Trait Implementations§
§impl Clone for BatteryInfo
impl Clone for BatteryInfo
§fn clone(&self) -> BatteryInfo
fn clone(&self) -> BatteryInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for BatteryInfo
impl Debug for BatteryInfo
§impl<D> Decode<BatteryInfo, D> for BatteryInfowhere
D: ResourceDialect,
impl<D> Decode<BatteryInfo, D> for BatteryInfowhere
D: ResourceDialect,
§fn new_empty() -> BatteryInfo
fn new_empty() -> BatteryInfo
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for BatteryInfo
impl Default for BatteryInfo
§fn default() -> BatteryInfo
fn default() -> BatteryInfo
§impl<D> Encode<BatteryInfo, D> for &BatteryInfowhere
D: ResourceDialect,
impl<D> Encode<BatteryInfo, D> for &BatteryInfowhere
D: ResourceDialect,
§impl PartialEq for BatteryInfo
impl PartialEq for BatteryInfo
§impl TypeMarker for BatteryInfo
impl TypeMarker for BatteryInfo
§type Owned = BatteryInfo
type Owned = BatteryInfo
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for BatteryInfo
impl ValueTypeMarker for BatteryInfo
§type Borrowed<'a> = &'a BatteryInfo
type Borrowed<'a> = &'a BatteryInfo
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<BatteryInfo as TypeMarker>::Owned,
) -> <BatteryInfo as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<BatteryInfo as TypeMarker>::Owned, ) -> <BatteryInfo as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.