-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to parse D-Bus configuration file(s) #78
Labels
feature parity
Feature parity with existing bus impls
Comments
41 tasks
jokeyrhyme
added a commit
to jokeyrhyme/busd
that referenced
this issue
Dec 9, 2024
We can deserialize an XML file using the "serde" and "quick-xml" crates. Creating a struct type with nested structs within is a direct approach that works well with `#[derive(Deserialize)]`. However, the result isn't optimal for consumption, and also makes it very difficult to implement aspects of the business logic that are sensitive to the order of certain XML elements, e.g. `<bus>`, `<include>`, etc. So our approach is to first deserialize into a `Vec<Element>` (inspired by @elmarco 's work over in dbus2#23 ). Importantly, by starting with this intermediate representation, we can preserve the XML author's intention regarding the order of elements. Then we replace any `<include>` and `<includedir>` elements with the parsed contents the XML files to which they refer, further replacing any `<include>` and `<includedir>` elements within those. Finally, we can make one final iteration over the `Vec<Element>` to produce the final optimally-structured `Config`. Fixes dbus2#78
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To be a drop-in replacement for the existing bus implementations, we need to be able to parse D-Bus XML configuration. Moreover, we should provide default files with easy method to install them as well (#77 should help with that).
The text was updated successfully, but these errors were encountered: