[−][src]Struct lsm::Battery
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:
Battery::STATUS_UNKNOWN
Battery::STATUS_OTHER
Battery::STATUS_OK
Battery::STATUS_DISCHARGING
Battery::STATUS_CHARGING
Battery::STATUS_LEARNING
Battery::STATUS_DEGRADED
Battery::STATUS_ERROR
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,