1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Getting the device's battery's state, if any
use Knowledge;
use Duration;
/// One of: Wired, FullyCharged, Charging and Discharging.
/// The battery's state and useful associated information - Get it for the
/// user's device with the associated `query()` function.
///
/// It's all packed into a single struct because on most platforms, it's
/// cheaper to query everything at once rather than "coming back" for
/// individual pieces of information.