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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//!# Systemdzbus
//!
//!Interact with systemd through DBus with a convenient rust interface.
//!All of the manager proxy types were automatically generated by the CLI tool 'zbus-xmlgen'.
//!From here I just copied the documentation from the systemd man page to
//!get good descriptions for each function.
//!
//!The plan is to gradually start wrapping each of the types into more descriptive types informed
//!by the man pages, mainly found in "man org.freedesktop.systemd1".
//!
//!## Usage
//!
//!```rust
//! use std::error::Error;
//! use systemdzbus::SystemCtlBuilder;
//!
//! async fn example_get_units() -> Result<(), Box::<dyn Error>> {
//! let systemctl = SystemCtlBuilder::new()
//! // You may also want to have access to the system bus instead of only the user bus
//! .with_system_connection_level()
//! .init()
//! .await?;
//!
//! let units = systemctl.list_units().await?;
//!
//! assert!(!units.is_empty());
//!
//! Ok(())
//! }
//!```
//!
//!You may also access the manager proxy directly if managing the connection yourself suits your
//!needs better.
//!To find out more about how to use the Connection, see the [zbus library](https://docs.rs/zbus/latest/zbus/).
//!
//!```rust
//! use std::error::Error;
//! use systemdzbus::{ManagerProxy, Connection, SystemCtlBuilder};
//!
//! async fn example_get_units_manager_proxy() -> Result<(), Box::<dyn Error>> {
//! /// Create zbus connection. You can also use Connection::session() here.
//! let connection = Connection::system().await?;
//!
//! /// Create proxy per zbus
//! let proxy = ManagerProxy::new(&connection).await?;
//!
//! /// Use the methods on the proxy. These are the ones
//! /// that are actually documented here
//! let units_raw = proxy.list_units().await?;
//!
//! assert!(!units_raw.is_empty());
//!
//! /// Or you can still have your connection managed, but still have direct access to
//! /// manager.
//! let systemctl = SystemCtlBuilder::new().init().await?;
//!
//! let manager = systemctl.get_manager_proxy();
//!
//! let units_raw = manager.list_units().await?;
//!
//! assert!(!units_raw.is_empty());
//!
//! Ok(())
//! }
//!```
//!
//! # D-Bus interface proxy for: `org.freedesktop.systemd1.Manager`
//!
//! In terms of the ManagerProxy:
//! This code was generated by `zbus-xmlgen` `5.1.0` from D-Bus introspection data.
//! Source: `Interface '/org/freedesktop/systemd1' from service 'org.freedesktop.systemd1' on system bus`.
//!
//! More information can be found in the [Writing a client proxy] section of the zbus
//! documentation.
//!
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
pub use ManagerProxy;
pub use Job;
pub use SystemCtlBuilder;
pub use SystemCtlBlockingBuilder;
pub use ;
pub use ;
pub use ;