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§
Source§impl Clone for BatteryInfo
impl Clone for BatteryInfo
Source§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 moreSource§impl Debug for BatteryInfo
impl Debug for BatteryInfo
Source§impl<D: ResourceDialect> Decode<BatteryInfo, D> for BatteryInfo
impl<D: ResourceDialect> Decode<BatteryInfo, D> for BatteryInfo
Source§impl Default for BatteryInfo
impl Default for BatteryInfo
Source§fn default() -> BatteryInfo
fn default() -> BatteryInfo
Returns the “default value” for a type. Read more
Source§impl<D: ResourceDialect> Encode<BatteryInfo, D> for &BatteryInfo
impl<D: ResourceDialect> Encode<BatteryInfo, D> for &BatteryInfo
Source§impl PartialEq for BatteryInfo
impl PartialEq for BatteryInfo
Source§impl TypeMarker for BatteryInfo
impl TypeMarker for BatteryInfo
Source§type Owned = BatteryInfo
type Owned = BatteryInfo
The owned Rust type which this FIDL type decodes into.
Source§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.
Source§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.Source§impl ValueTypeMarker for BatteryInfo
impl ValueTypeMarker for BatteryInfo
Source§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 moreimpl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)