pub struct BatteryFields {
pub voltage: bool,
pub level: bool,
pub charge_state: bool,
}Expand description
Which battery measurements the platform is capable of reporting
through PROP_BATTERY. Fixed for the life of a session: these bits
bound the field-flags octet of every snapshot.
An individual sample may populate fewer fields than are advertised — a level estimated from resting terminal voltage has no value while the pack is charging, and the spec would rather see the field omitted than a number the device knows to be wrong. The reverse is refused: a sample carrying a field the platform never claimed cannot be encoded honestly, so it is rejected.
Fields§
§voltage: bool§level: bool§charge_state: boolImplementations§
Trait Implementations§
Source§impl Clone for BatteryFields
impl Clone for BatteryFields
Source§fn clone(&self) -> BatteryFields
fn clone(&self) -> BatteryFields
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatteryFields
impl Debug for BatteryFields
Source§impl Default for BatteryFields
impl Default for BatteryFields
Source§fn default() -> BatteryFields
fn default() -> BatteryFields
Returns the “default value” for a type. Read more
Source§impl PartialEq for BatteryFields
impl PartialEq for BatteryFields
impl Copy for BatteryFields
impl Eq for BatteryFields
impl StructuralPartialEq for BatteryFields
Auto Trait Implementations§
impl Freeze for BatteryFields
impl RefUnwindSafe for BatteryFields
impl Send for BatteryFields
impl Sync for BatteryFields
impl Unpin for BatteryFields
impl UnwindSafe for BatteryFields
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)