[][src]Struct lsm::Battery

pub struct Battery {
    pub id: String,
    pub name: String,
    pub battery_type: BatteryType,
    pub status: u64,
    pub system_id: String,
    // some fields omitted
}

Represent a battery.

Fields

id: String

Identifier.

name: String

Human friendly name.

battery_type: BatteryType

Battery type.

status: u64

Battery status stored in bitmap. Valid status value are:

if (b.status & Battery::STATUS_OK) == 0 {
    println!("Battery {}/{} is not healthy", b.name, b.id);
}
system_id: String

Identifier of owner system.

Methods

impl Battery[src]

pub const STATUS_UNKNOWN: u64[src]

Plugin failed to query battery status.

pub const STATUS_OTHER: u64[src]

Vendor specific status.

pub const STATUS_OK: u64[src]

Battery is healthy and charged.

pub const STATUS_DISCHARGING: u64[src]

Battery is disconnected from power source and discharging.

pub const STATUS_CHARGING: u64[src]

Battery is not fully charged and charging.

pub const STATUS_LEARNING: u64[src]

System is trying to discharge and recharge the battery to learn its capability.

pub const STATUS_DEGRADED: u64[src]

Battery is degraded and should be checked or replaced.

pub const STATUS_ERROR: u64[src]

Battery is dead and should be replaced.

Trait Implementations

impl Clone for Battery[src]

impl Debug for Battery[src]

impl<'de> Deserialize<'de> for Battery[src]

Auto Trait Implementations

impl RefUnwindSafe for Battery

impl Send for Battery

impl Sync for Battery

impl Unpin for Battery

impl UnwindSafe for Battery

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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.