Closed Phen-Ro closed 1 year ago
The original motivation for this was to make some tweaks to eruptionctl to output all device statuses. That required diving into the dbus interface code, and from there I just had to refactor the 2500 line file.
The way the dbus_tree API requires explicit declaration of parameter names and then also requires you to explicitly pull out the arguments, this makes me think there should be a better way of establishing fn metadata to generate the dbus_tree objects. Maybe I'll learn more about macros to do this, or maybe I'll just think about doing it and then get distracted. You never know.
Hi @Phen-Ro, thanks for this great work!
This will help with modifying and maintaining the dbus interface in the future. One file per mod, then one file per path/interface, plus one file for extra convenience functionality.
The refactored code should be identical to the original but with the following two exceptions: dbus_tx is wrapped in an Arc rather than cloned, and higher-order functions are used for checking permissions.