pub struct BatteryInfo {
pub unit: BatteryUnit,
pub design_capacity: u32,
pub last_full_capacity: u32,
pub design_voltage: u32,
pub capacity_warning: u32,
pub capacity_low: u32,
pub capacity_granularity_low_warning: u32,
pub capacity_granularity_warning_full: u32,
pub present_rate: i32,
pub remaining_capacity: u32,
pub present_voltage: u32,
pub battery_spec: BatterySpec,
}
Fields§
§unit: BatteryUnit
capacity unit. all voltage fields are in millivolts
design_capacity: u32
nominal capacity of a new battery
last_full_capacity: u32
predicted battery capacity when fully charged
design_voltage: u32
nominal voltage of a new battery
capacity_warning: u32
capacity when the device will generate a warning notification
capacity_low: u32
capacity when the device will generate a low battery notification
capacity_granularity_low_warning: u32
the smallest increment the battery is capable of measuring between the low and warning capacities
capacity_granularity_warning_full: u32
the smallest increment the battery is capable of measuring between the low and warning capacities
present_rate: i32
below fields are in units specified the unit
field.
charging/discharging rate in the capacity unit. positive is charging,
negative is discharging
remaining_capacity: u32
§present_voltage: u32
§battery_spec: BatterySpec
specifications set by the manufacturer.
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<D: ResourceDialect> Encode<BatteryInfo, D> for &BatteryInfo
impl<D: ResourceDialect> Encode<BatteryInfo, D> for &BatteryInfo
Source§impl<D: ResourceDialect, T0: Encode<BatteryUnit, D>, T1: Encode<u32, D>, T2: Encode<u32, D>, T3: Encode<u32, D>, T4: Encode<u32, D>, T5: Encode<u32, D>, T6: Encode<u32, D>, T7: Encode<u32, D>, T8: Encode<i32, D>, T9: Encode<u32, D>, T10: Encode<u32, D>, T11: Encode<BatterySpec, D>> Encode<BatteryInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
impl<D: ResourceDialect, T0: Encode<BatteryUnit, D>, T1: Encode<u32, D>, T2: Encode<u32, D>, T3: Encode<u32, D>, T4: Encode<u32, D>, T5: Encode<u32, D>, T6: Encode<u32, D>, T7: Encode<u32, D>, T8: Encode<i32, D>, T9: Encode<u32, D>, T10: Encode<u32, D>, T11: Encode<BatterySpec, D>> Encode<BatteryInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
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
)