[−][src]Struct battery::Battery
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
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,