[][src]Struct battery::Battery

pub struct Battery<T: Device> { /* fields omitted */ }

Battery instant information representation.

Consequent calls of the same method will return the same value.

Methods

impl<T> Battery<T> where
    T: Device
[src]

pub fn state(&self) -> State[src]

Gets battery current state.

See State enum for possible values.

pub fn technology(&self) -> Technology[src]

Gets battery technology.

See Technology enum for possible values.

pub fn vendor(&self) -> Option<&str>[src]

Gets battery vendor.

Might not exist.

pub fn model(&self) -> Option<&str>[src]

Gets battery model.

Might not exist.

pub fn serial_number(&self) -> Option<&str>[src]

Gets battery serial number.

Might not exist.

pub fn capacity(&self) -> f64[src]

Gets battery capacity in 0.0..100.0 percents range.

pub fn temperature(&self) -> f64[src]

Gets battery temperature in Celsius degrees.

pub fn percentage(&self) -> f64[src]

pub fn energy(&self) -> f64[src]

Wh

pub fn energy_full(&self) -> f64[src]

pub fn energy_full_design(&self) -> f64[src]

pub fn energy_rate(&self) -> f64[src]

pub fn voltage(&self) -> f64[src]

Gets a battery voltage (in V).

pub fn time_to_full(&self) -> Option<Duration>[src]

Gets a remaining time till full battery.

This is an instant value and may different vastly from call to call. Any aggregation should be made by caller.

If battery is not charging at the moment, this method will return None.

pub fn time_to_empty(&self) -> Option<Duration>[src]

Gets a remaining time till empty battery.

This is an instant value and may different vastly from call to call. Any aggregation should be made by caller.

If battery is not discharging at the moment, this method will return None.

Trait Implementations

impl<T> Debug for Battery<T> where
    T: Device
[src]

Auto Trait Implementations

impl<T> Send for Battery<T> where
    T: Send

impl<T> Sync for Battery<T> where
    T: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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