systemdzbus

Crates.iosystemdzbus
lib.rssystemdzbus
version0.1.3
created_at2025-06-06 21:33:14.31617+00
updated_at2025-06-06 22:03:24.049804+00
descriptionInteract 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.
homepagehttps://github.com/GerhardusC/systemdzbus
repositoryhttps://github.com/GerhardusC/systemdzbus
max_upload_size
id1703490
size78,332
Gerhardus (GerhardusC)

documentation

README

Systemdzbus

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.

Usage

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.

Purpose

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.

Commit count: 16

cargo fmt