use dbus_async::DBus;
use dbus_message_parser::Message;
use futures::channel::mpsc::channel;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() {
let (dbus, _connection_handle) = DBus::session(true)
.await
.expect("failed to get the DBus object");
let object_path = "object/path/test".to_string();
let (sender, mut receiver) = channel::<Message>(1024);
if let Err(e) = dbus.add_object_path(object_path, sender) {
panic!("Cannot add path: {:?}", e);
}
while let Some(msg) = receiver.next().await {
println!("{:?}", msg);
}
}