dbus-async
A pure Rust written asynchronous DBus library.
Usage
Add this to your Cargo.toml
:
[dependencies]
dbus-async = "1.0"
Example
use dbus_async::DBus;
use dbus_message_parser::Message;
#[tokio::main]
async fn main() {
let (dbus, _server_handle) = DBus::session(true)
.await
.expect("failed to get the DBus object");
let msg = Message::method_call(
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus.Peer",
"Ping",
);
let return_msg = dbus.call(msg).await;
println!("{:?}", return_msg);
}
If you want to implement a DBus service and do not implement the dbus_async::Handler
trait
manually then use dbus-async-derive
crate.
TODO