Struct dmc::battery::BatteryState [] [src]

pub struct BatteryState {
    pub status: Knowledge<BatteryStatus>,
    pub estimated_time_remaining: Knowledge<Duration>,
    pub percentage_remaining: Knowledge<f32>,
}

The battery's state and useful associated information - Get it for the user's device with the associated query() function.

It's all packed into a single struct because on most platforms, it's cheaper to query everything at once rather than "coming back" for individual pieces of information.

Fields

The value is between 0 and 1 (both inclusive).

Methods

impl BatteryState
[src]

Query the user's device's battery's current state.

You should consider this operation as expensive, and the result is not implicitly cached - it's up to you to cache it by yourself if you want to.

Trait Implementations

impl Debug for BatteryState
[src]

Formats the value using the given formatter.

impl Default for BatteryState
[src]

Returns the "default value" for a type. Read more

impl Copy for BatteryState
[src]

impl Clone for BatteryState
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for BatteryState
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.