Enum gilrs::PowerInfo [−][src]
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
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 Debug for PowerInfo
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for PowerInfo
[src]
impl Copy for PowerInfo
impl Clone for PowerInfo
[src]
impl Clone for PowerInfo
fn clone(&self) -> PowerInfo
[src]
fn clone(&self) -> PowerInfo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for PowerInfo
[src]
impl PartialEq for PowerInfo