Add Proxy owner changed stream
This would be useful to track when a proxy got disconnected or reconnected from the destination.
Something like that should be fine, however future streams give me some headache, help welcome:
pub type OwnerChangedStream = FIXME;
/// Get a stream to receive destination owner changed events.
pub async fn receive_owner_changed(&self) -> Result<OwnerChangedStream> {
use futures_util::StreamExt;
use std::future::ready;
let dbus_proxy = fdo::DBusProxy::builder(self.connection())
.cache_properties(CacheProperties::No)
.build()
.await?;
let proxy = self.clone();
Ok(dbus_proxy
.receive_name_owner_changed()
.await?
.filter_map(|signal| {
let args = signal.args().unwrap();
if args.name() != proxy.destination() {
return ready(None);
}
ready(Some(args.new_owner))
}))
}