zbus-old icon indicating copy to clipboard operation
zbus-old copied to clipboard

dbus_proxy macro to provide property PropertiesChanged signal handling helpers

Open zeenix opened this issue 4 years ago • 4 comments

While it's already possible to add signal handler for this through the newly-added (!206) zbus::fdo::Properties::properties_changed API, it'd be best if we provide a more direct and convenient way to do this.

Also once #142 is resolved, we'll want a stream version as well.

zeenix avatar Jan 01 '21 16:01 zeenix

In GitLab by @bilelmoussaoui on Jan 2, 2021, 03:03

So the idea is to automatically generate connect_$prop_name_changed signals? If that's the case, there has to be a way to omit it for certain properties, mostly thinking of the pretty common "version" ones

zeenix avatar Jan 02 '21 02:01 zeenix

So the idea is to automatically generate connect_$prop_name_changed signals?

Yeah but probably also a generic, zbus::Proxy::connect_property_change(&mut self, prop_name).

f that's the case, there has to be a way to omit it for certain properties, mostly thinking of the pretty common "version" ones

Not sure I follow. Why do we need to omit some props?

zeenix avatar Jan 02 '21 12:01 zeenix

In GitLab by @bilelmoussaoui on Jan 2, 2021, 15:36

Not sure I follow. Why do we need to omit some props?

Well, what I was thinking of is that the version property for example doesn't change that "often" and having a signal for that one doesn't make much sense to me at least, hence my idea for having the possibility to omit them :)

zeenix avatar Jan 02 '21 14:01 zeenix

Ah ok, yeah then it'd make sure to add an attribute to declare the property, 'const'. Unfortunately const fn isn't yet possible inside traits cause that would have made sense instead of attribute but we can change it in the future.

zeenix avatar Jan 02 '21 17:01 zeenix