pub struct PowerDevice {
pub path: String,
pub kind: DeviceKind,
pub model: String,
pub icon_name: String,
pub present: bool,
pub power_supply: bool,
pub state: BatteryState,
pub percent: f64,
pub time_to_empty: Option<Duration>,
pub time_to_full: Option<Duration>,
pub energy_rate: f64,
}Expand description
A battery or power supply UPower knows.
Fields§
§path: StringUPower’s object path for it, which names it while it exists.
kind: DeviceKindWhat it is.
model: StringIts model name, or "".
icon_name: StringThe icon UPower suggests, such as battery-good-charging-symbolic.
present: boolWhether a battery is in its bay.
power_supply: boolWhether it powers this machine, rather than a gadget.
state: BatteryStateHow it is doing.
percent: f64How full it is, from 0 to 100.
time_to_empty: Option<Duration>How long until it runs out, if UPower knows.
time_to_full: Option<Duration>How long until it is full, if UPower knows.
energy_rate: f64The power going in or out, in watts.
Trait Implementations§
Source§impl Clone for PowerDevice
impl Clone for PowerDevice
Source§impl Debug for PowerDevice
impl Debug for PowerDevice
Source§impl Default for PowerDevice
impl Default for PowerDevice
Source§impl PartialEq for PowerDevice
impl PartialEq for PowerDevice
impl StructuralPartialEq for PowerDevice
Auto Trait Implementations§
impl Forget for PowerDevice
impl Freeze for PowerDevice
impl Move for PowerDevice
impl RefUnwindSafe for PowerDevice
impl Send for PowerDevice
impl Sync for PowerDevice
impl Unpin for PowerDevice
impl UnsafeUnpin for PowerDevice
impl UnwindSafe for PowerDevice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.