8 releases
Uses new Rust 2024
| new 0.1.7 | Mar 5, 2026 |
|---|---|
| 0.1.6 | Mar 3, 2026 |
| 0.1.4 | Feb 28, 2026 |
| 0.1.3 | Jun 6, 2025 |
#656 in Unix APIs
105KB
1.5K
SLoC
Systemdzbus
Interact with systemd through DBus with a convenient rust interface. The manager proxy types were generated by '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 wrap all useful functionality in nice to use types. For now, what I have done is I have wrapped some of the most used systemctl functions into the wrapper and added very simple type conversions.
Usage
use std::error::Error;
use systemdzbus::SystemCtlBuilder;
async fn example_get_units() -> Result<(), Box::<dyn Error>> {
let systemctl = SystemCtlBuilder::new()
// You may 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(())
}
Purpose
The entire use of this project was for me to get better documentation for the automatic types generated by 'zbus-xmlgen' and to have a nice interface on top of the raw manager proxy.
Dependencies
~11–19MB
~319K SLoC