[][src]Struct battery::Battery

pub struct Battery { /* fields omitted */ }

Battery information representation

Methods

impl Battery[src]

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

Current battery state

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

Current (momentary) capacity (in mWh).

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

Last known full capacity (in mWh).

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

Reported design capacity (in mWh).

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

Current (momentary) charge rate (in mW). It is always non-negative, consult state() method to check whether it means charging or discharging.

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

Design voltage (in V). Some systems (e.g. macOS) do not provide a separate value for this. In such cases, or if getting this fails, but getting voltage() succeeds, this field will have the same value as voltage(), for convenience.

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

Current voltage (in V).

Trait Implementations

impl Debug for Battery[src]

Auto Trait Implementations

impl Send for Battery

impl Sync for Battery

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]