Enum gilrs::PowerInfo[][src]

pub enum PowerInfo {
    Unknown,
    Wired,
    Discharging(u8),
    Charging(u8),
    Charged,
}

State of device's power supply.

Battery level is reported as integer between 0 and 100.

Example

use gilrs::PowerInfo;

match gilrs[0].power_info() {
    PowerInfo::Discharging(lvl) if lvl <= 10 => println!("Low battery level, you should \
                                                          plug your gamepad"),
    _ => (),
};

Variants

Failed to determine power status.

Device doesn't have battery.

Device is running on the battery.

Battery is charging.

Battery is charged.

Trait Implementations

impl Debug for PowerInfo
[src]

Formats the value using the given formatter. Read more

impl Copy for PowerInfo
[src]

impl Clone for PowerInfo
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for PowerInfo
[src]

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

This method tests for !=.

Auto Trait Implementations

impl Send for PowerInfo

impl Sync for PowerInfo