Struct BatteryInfo
pub struct BatteryInfo {
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>,
/* 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
Trait Implementations§
§impl Clone for BatteryInfo
impl Clone for BatteryInfo
§fn clone(&self) -> BatteryInfo
fn clone(&self) -> BatteryInfo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Creates a valid instance of
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
Returns the “default value” for a type. Read more
§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
The owned Rust type which this FIDL type decodes into.
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
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
Returns true if the memory layout of
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
The Rust type to use for encoding. This is a particular
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<'_>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.impl Persistable for BatteryInfo
impl StructuralPartialEq for BatteryInfo
Auto Trait Implementations§
impl Freeze for BatteryInfo
impl RefUnwindSafe for BatteryInfo
impl Send for BatteryInfo
impl Sync for BatteryInfo
impl Unpin for BatteryInfo
impl UnwindSafe for BatteryInfo
Blanket Implementations§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
The marker type to use when the body is at the top-level.
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
The marker type to use when the body is nested in a result union.
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