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
use zbus::zvariant::OwnedValue;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("cannot connect to dbus: {0}")]
DBusConnectionFail(zbus::Error),
#[error("cannot get a valid dbus path: {0}")]
DBusInvalidPath(zbus::zvariant::Error),
#[error("cannot start listening property change events: {0}")]
ListenPropertyChangeFail(zbus::Error),
#[error("cannot parse the property change event: {0}")]
ParsePropertyChangeFail(zbus::Error),
#[error("cannot query the property: {0}")]
QueryPropertyFail(zbus::fdo::Error),
#[error("cannot start the transient service: {0}")]
StartFail(zbus::Error),
#[error("cannot calculate {0} time usage: t0 = {1:?}, t1 = {2:?}")]
TimeUsageFail(&'static str, Box<OwnedValue>, Box<OwnedValue>),
}
pub type Result<T> = std::result::Result<T, Error>;