| Crates.io | systemdzbus |
| lib.rs | systemdzbus |
| version | 0.1.3 |
| created_at | 2025-06-06 21:33:14.31617+00 |
| updated_at | 2025-06-06 22:03:24.049804+00 |
| description | Interact with systemd through DBus with a convenient rust interface. All of the code was 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. |
| homepage | https://github.com/GerhardusC/systemdzbus |
| repository | https://github.com/GerhardusC/systemdzbus |
| max_upload_size | |
| id | 1703490 |
| size | 78,332 |
Interact with systemd through DBus with a convenient rust interface. All of the code was 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.
To find out more about how to use the Connection, see the zbus library.
use systemdzbus::{Connection, manager::ManagerProxy};
async fn example_get_units() -> Result<()> {
/// 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 res = proxy.list_units().await?;
assert!(res.len() > 0);
Ok(())
}
Because this is literally just the zbus library, and I contributed absolutely nothing special, I think it is async runtime agnostic. I don't know, I've used smol and tokio.
The entire use of this project was for me to get documentation for the automatic types generated by 'zbus-xmlgen'. I got tired of reading through the man pages, so I brought the man pages into the function definitions.