#[non_exhaustive]pub struct Battery {
pub charge: Percent,
pub state: BatteryState,
pub time_to_empty: Option<Duration>,
pub time_to_full: Option<Duration>,
pub health: Option<Percent>,
pub cycles: Option<u32>,
}Expand description
A battery, or several combined.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.charge: PercentHow full it is.
state: BatteryStateWhat it is doing.
time_to_empty: Option<Duration>How long it lasts at the present draw, when the OS can tell.
time_to_full: Option<Duration>How long until it is full, when the OS can tell.
health: Option<Percent>Full capacity over design capacity.
cycles: Option<u32>Charge cycles.
Trait Implementations§
impl Copy for Battery
impl StructuralPartialEq for Battery
Auto Trait Implementations§
impl Forget for Battery
impl Freeze for Battery
impl Move for Battery
impl RefUnwindSafe for Battery
impl Send for Battery
impl Sync for Battery
impl Unpin for Battery
impl UnsafeUnpin for Battery
impl UnwindSafe for Battery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more