Skip to content
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

Props doesn't work with arg #39

Closed
agrover opened this issue Apr 11, 2016 · 2 comments
Closed

Props doesn't work with arg #39

agrover opened this issue Apr 11, 2016 · 2 comments

Comments

@agrover
Copy link
Contributor

agrover commented Apr 11, 2016

Props returns MessageItem, so one can't use dbus::arg::Array and friends, which I thought was recommended over MessageItem these days?

@diwic
Copy link
Owner

diwic commented Apr 12, 2016

Yep, very true. The problem boils down to limitations in the Rust type system. A property can't be generic over Arg - it has to be a Box<Arg> or something like that, otherwise you can't have more than one type of property in a Tree (which is a non-starter). However, Box<Arg> is impossible because it contains static methods and can therefore not be turned into a trait object.

I experimented with making a trait similar to Arg but taking &self as argument instead of no argument, but never finished it properly.

@diwic
Copy link
Owner

diwic commented Sep 3, 2016

Hi, I just released v0.4.0 of dbus-rs, which includes a rewrite of the tree module and in the process, it fixes this issue. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants