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.gamepad(0).power_info() { PowerInfo::Discharging(lvl) if lvl <= 10 => println!("Low battery level, you should \ plug your gamepad"), _ => (), };
Variants
Unknown
Failed to determine power status.
Wired
Device doesn't have battery.
Discharging(u8)
Device is running on the battery.
Charging(u8)
Battery is charging.
Charged
Battery is charged.
Trait Implementations
impl Debug for PowerInfo
[src]
impl Copy for PowerInfo
[src]
impl Clone for PowerInfo
[src]
fn clone(&self) -> PowerInfo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more