chore: cargo fmt & geoclue docs
This commit is contained in:
parent
c83767c7e5
commit
8b9767f6ce
7 changed files with 199 additions and 191 deletions
|
|
@ -8,115 +8,115 @@ use zbus::zvariant::OwnedValue;
|
|||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Deserialize_repr, Serialize_repr, OwnedValue)]
|
||||
#[repr(u32)]
|
||||
pub enum BatteryState {
|
||||
Unknown = 0,
|
||||
Charging = 1,
|
||||
Discharging = 2,
|
||||
Empty = 3,
|
||||
FullyCharged = 4,
|
||||
PendingCharge = 5,
|
||||
PendingDischarge = 6,
|
||||
Unknown = 0,
|
||||
Charging = 1,
|
||||
Discharging = 2,
|
||||
Empty = 3,
|
||||
FullyCharged = 4,
|
||||
PendingCharge = 5,
|
||||
PendingDischarge = 6,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Deserialize_repr, Serialize_repr, OwnedValue)]
|
||||
#[repr(u32)]
|
||||
pub enum BatteryType {
|
||||
Unknown = 0,
|
||||
LinePower = 1,
|
||||
Battery = 2,
|
||||
Ups = 3,
|
||||
Monitor = 4,
|
||||
Mouse = 5,
|
||||
Keyboard = 6,
|
||||
Pda = 7,
|
||||
Phone = 8,
|
||||
Unknown = 0,
|
||||
LinePower = 1,
|
||||
Battery = 2,
|
||||
Ups = 3,
|
||||
Monitor = 4,
|
||||
Mouse = 5,
|
||||
Keyboard = 6,
|
||||
Pda = 7,
|
||||
Phone = 8,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Deserialize_repr, Serialize_repr, OwnedValue)]
|
||||
#[repr(u32)]
|
||||
pub enum BatteryLevel {
|
||||
Unknown = 0,
|
||||
None = 1,
|
||||
Low = 3,
|
||||
Critical = 4,
|
||||
Normal = 6,
|
||||
High = 7,
|
||||
Full = 8,
|
||||
Unknown = 0,
|
||||
None = 1,
|
||||
Low = 3,
|
||||
Critical = 4,
|
||||
Normal = 6,
|
||||
High = 7,
|
||||
Full = 8,
|
||||
}
|
||||
|
||||
#[dbus_proxy(
|
||||
interface = "org.freedesktop.UPower.Device",
|
||||
default_service = "org.freedesktop.UPower",
|
||||
assume_defaults = false
|
||||
interface = "org.freedesktop.UPower.Device",
|
||||
default_service = "org.freedesktop.UPower",
|
||||
assume_defaults = false
|
||||
)]
|
||||
trait Device {
|
||||
#[dbus_proxy(property)]
|
||||
fn battery_level(&self) -> zbus::Result<BatteryLevel>;
|
||||
#[dbus_proxy(property)]
|
||||
fn battery_level(&self) -> zbus::Result<BatteryLevel>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn capacity(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn capacity(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn energy(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn energy(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_empty(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_empty(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_full(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_full(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_full_design(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn energy_full_design(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn has_history(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn has_history(&self) -> zbus::Result<bool>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn has_statistics(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn has_statistics(&self) -> zbus::Result<bool>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn icon_name(&self) -> zbus::Result<String>;
|
||||
#[dbus_proxy(property)]
|
||||
fn icon_name(&self) -> zbus::Result<String>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn is_present(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn is_present(&self) -> zbus::Result<bool>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn is_rechargeable(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn is_rechargeable(&self) -> zbus::Result<bool>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn luminosity(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn luminosity(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn model(&self) -> zbus::Result<String>;
|
||||
#[dbus_proxy(property)]
|
||||
fn model(&self) -> zbus::Result<String>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn native_path(&self) -> zbus::Result<String>;
|
||||
#[dbus_proxy(property)]
|
||||
fn native_path(&self) -> zbus::Result<String>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn online(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn online(&self) -> zbus::Result<bool>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn percentage(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn percentage(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn power_supply(&self) -> zbus::Result<bool>;
|
||||
#[dbus_proxy(property)]
|
||||
fn power_supply(&self) -> zbus::Result<bool>;
|
||||
|
||||
fn refresh(&self) -> zbus::Result<()>;
|
||||
fn refresh(&self) -> zbus::Result<()>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn serial(&self) -> zbus::Result<String>;
|
||||
#[dbus_proxy(property)]
|
||||
fn serial(&self) -> zbus::Result<String>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn state(&self) -> zbus::Result<BatteryState>;
|
||||
#[dbus_proxy(property)]
|
||||
fn state(&self) -> zbus::Result<BatteryState>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn temperature(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn temperature(&self) -> zbus::Result<f64>;
|
||||
|
||||
#[dbus_proxy(property, name = "Type")]
|
||||
fn type_(&self) -> zbus::Result<BatteryType>;
|
||||
#[dbus_proxy(property, name = "Type")]
|
||||
fn type_(&self) -> zbus::Result<BatteryType>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn vendor(&self) -> zbus::Result<String>;
|
||||
#[dbus_proxy(property)]
|
||||
fn vendor(&self) -> zbus::Result<String>;
|
||||
|
||||
#[dbus_proxy(property)]
|
||||
fn voltage(&self) -> zbus::Result<f64>;
|
||||
#[dbus_proxy(property)]
|
||||
fn voltage(&self) -> zbus::Result<f64>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,37 +7,37 @@ use crate::device::{DeviceProxy, DeviceProxyBlocking};
|
|||
|
||||
#[dbus_proxy(interface = "org.freedesktop.UPower", assume_defaults = true)]
|
||||
trait UPower {
|
||||
/// EnumerateDevices method
|
||||
fn enumerate_devices(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
|
||||
/// EnumerateDevices method
|
||||
fn enumerate_devices(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;
|
||||
|
||||
/// GetCriticalAction method
|
||||
fn get_critical_action(&self) -> zbus::Result<String>;
|
||||
/// GetCriticalAction method
|
||||
fn get_critical_action(&self) -> zbus::Result<String>;
|
||||
|
||||
/// GetDisplayDevice method
|
||||
#[dbus_proxy(object = "Device")]
|
||||
fn get_display_device(&self);
|
||||
/// GetDisplayDevice method
|
||||
#[dbus_proxy(object = "Device")]
|
||||
fn get_display_device(&self);
|
||||
|
||||
/// DeviceAdded signal
|
||||
#[dbus_proxy(signal)]
|
||||
fn device_added(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
|
||||
/// DeviceAdded signal
|
||||
#[dbus_proxy(signal)]
|
||||
fn device_added(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
|
||||
|
||||
/// DeviceRemoved signal
|
||||
#[dbus_proxy(signal)]
|
||||
fn device_removed(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
|
||||
/// DeviceRemoved signal
|
||||
#[dbus_proxy(signal)]
|
||||
fn device_removed(&self, device: zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;
|
||||
|
||||
/// DaemonVersion property
|
||||
#[dbus_proxy(property)]
|
||||
fn daemon_version(&self) -> zbus::Result<String>;
|
||||
/// DaemonVersion property
|
||||
#[dbus_proxy(property)]
|
||||
fn daemon_version(&self) -> zbus::Result<String>;
|
||||
|
||||
/// LidIsClosed property
|
||||
#[dbus_proxy(property)]
|
||||
fn lid_is_closed(&self) -> zbus::Result<bool>;
|
||||
/// LidIsClosed property
|
||||
#[dbus_proxy(property)]
|
||||
fn lid_is_closed(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// LidIsPresent property
|
||||
#[dbus_proxy(property)]
|
||||
fn lid_is_present(&self) -> zbus::Result<bool>;
|
||||
/// LidIsPresent property
|
||||
#[dbus_proxy(property)]
|
||||
fn lid_is_present(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// OnBattery property
|
||||
#[dbus_proxy(property)]
|
||||
fn on_battery(&self) -> zbus::Result<bool>;
|
||||
/// OnBattery property
|
||||
#[dbus_proxy(property)]
|
||||
fn on_battery(&self) -> zbus::Result<bool>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue