pub struct UPower { /* private fields */ }Expand description
UPower’s batteries and power supplies, from cx.upower(). Cloning it
is cheap.
Implementations§
Source§impl UPower
impl UPower
Sourcepub fn devices(&self) -> ReadSignal<Vec<PowerDevice>>
pub fn devices(&self) -> ReadSignal<Vec<PowerDevice>>
Every device, in the order UPower lists them. Empty while UPower isn’t running.
Sourcepub fn display_device(&self) -> ReadSignal<Option<PowerDevice>>
pub fn display_device(&self) -> ReadSignal<Option<PowerDevice>>
The one device that sums up the machine’s batteries, as a battery
icon in a bar shows. On a machine with none, it isn’t present.
None while UPower isn’t running.
Sourcepub fn on_battery(&self) -> ReadSignal<bool>
pub fn on_battery(&self) -> ReadSignal<bool>
Whether the machine runs on battery.
Trait Implementations§
Auto Trait Implementations§
impl !Send for UPower
impl !Sync for UPower
impl Forget for UPower
impl Freeze for UPower
impl Move for UPower
impl RefUnwindSafe for UPower
impl Unpin for UPower
impl UnsafeUnpin for UPower
impl UnwindSafe for UPower
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