Derive macro for generating method tuples from structs #456
Replies: 2 comments 15 replies
-
Hey, interesting stuff! :-) As for trying to upstream it - let's have a discussion about it and see how things go? I had a bird's eye look at the code, and so my main question is about the traits (DbusArg and DbusDictKey), any reason you can't use existing traits such as As for this question:
The reason is that since dbus protocol specifies that f64 and Files can be dict keys I do my best to support that. But it would be rather weird and I haven't seen anyone using it in practice. |
Beta Was this translation helpful? Give feedback.
-
Hi! I've been looking at your crate and it looks better now :-) I think I understand most of it, it might need a bit more of tests/documentation/readme so users understand how to use it. Also the "rename" option of DbusPropMap seems to be untested and undocumented. I have a question about DbusArgs - it seems to assume the args is in a struct so it should probably be named DbusStruct instead? A version that does not descend into a struct might be even more useful - you could e g use it with |
Beta Was this translation helpful? Give feedback.
-
I've been working on a small personal project, which is my first experience with both DBus and dbus-rs. To be more exact, I wanted to interact with Mutter DisplayConfig, and almost immediately I came to a conclusion that managing needed arguments in form of tuples would be a nightmare.
Instead, I spent 3 days writing a proof of concept derive macro, which takes a struct and generates a tuple type from it, plus implements TryFrom in both directions. Here is my derive macro and here is an example of how I'm using it.
So, my question: Is this something that is worth trying to upstream? I'd love to get any kind of feedback on this.
Beta Was this translation helpful? Give feedback.
All reactions