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
use zbus::dbus_proxy;
use crate::device::{DeviceProxy, DeviceProxyBlocking};
#[dbus_proxy(interface = "org.freedesktop.UPower", assume_defaults = true)]
trait UPower {
fn enumerate_devices(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
fn get_critical_action(&self) -> zbus::Result<String>;
#[dbus_proxy(object = "Device")]
fn get_display_device(&self);
#[dbus_proxy(signal)]
fn device_added(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
#[dbus_proxy(signal)]
fn device_removed(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
#[dbus_proxy(property)]
fn daemon_version(&self) -> zbus::Result<String>;
#[dbus_proxy(property)]
fn lid_is_closed(&self) -> zbus::Result<bool>;
#[dbus_proxy(property)]
fn lid_is_present(&self) -> zbus::Result<bool>;
#[dbus_proxy(property)]
fn on_battery(&self) -> zbus::Result<bool>;
}