https://docs.rs/dbus/0.8.2/dbus/message/struct.Message.html
fn main() -> Result<(), std::io::Error> {
// First open up a connection to the session bus.
let mut conn = Connection::new_session().expect("D-Bus connection failed");
// Second create a rule to match messages we want to receive; in this example we add no
// further requirements, so all messages will match
let mut rule = MatchRule::new();
rule.path = Some("/org/freedesktop/Notifications".into());
// rule.eavesdrop = true; // this lets us eavesdrop on *all* session messages, not just ours
// Start matching
conn.add_match(rule, |_: (), _, msg| {
// how make msg as mut msg
println!("{:?}", msg.as_result()); // error
true
}).expect("failed");
loop {
conn.process(Duration::from_millis(1000)).unwrap();
}