[][src]Enum libmtp_rs::device::BatteryLevel

pub enum BatteryLevel {
    OnBattery(u8),
    OnExternalPower,
}

Information about the battery level gather from a device with MtpDevice::battery_level.

Example

let (level, max_level) = mtp_device.battery_level().expect("Failed to get battery level");
match level {
    BatteryLevel::OnBattery(level) => println!("Using battery, current level {}", level),
    BatteryLevel::OnExternalPower => println!("Using external power, connected to AC"),
}

Variants

OnBattery(u8)

The device is currently on battery.

OnExternalPower

The device is currently on external power.

Trait Implementations

impl Clone for BatteryLevel[src]

impl Copy for BatteryLevel[src]

impl Debug for BatteryLevel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.