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

Add SerializeTuple and use it for code generated by #[dbus_proxy] #547

Merged
merged 4 commits into from
Jan 27, 2024

Conversation

danieldg
Copy link
Collaborator

Fixes: #542

Copy link
Contributor

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise. Thanks for looking into this. 👍

@danieldg danieldg force-pushed the proxy-dynamic-tuples branch 2 times, most recently from fc0d7dc to a8ce30b Compare January 18, 2024 01:01
@danieldg danieldg marked this pull request as ready for review January 18, 2024 01:06
Copy link
Contributor

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that some nits on the commit logs:

  • " zb: Relax type bound on call/call_with_flags" doesn't say what restriction is being lifted.
  • " zv: add OwnedStructure" could use a very short rationale.

@danieldg danieldg force-pushed the proxy-dynamic-tuples branch from a8ce30b to 33548c8 Compare January 19, 2024 00:35
@zeenix
Copy link
Contributor

zeenix commented Jan 27, 2024

@danieldg this got off my radar. All review comments addressed?

@danieldg
Copy link
Collaborator Author

I believe so.

@zeenix
Copy link
Contributor

zeenix commented Jan 27, 2024

" zv: add OwnedStructure" could use a very short rationale.

Still the case but ok, no biggie.

I forgot to mention, we've started doing emoji prefixes in git commits. Could you please add those? Should be pretty easy with my gimoji tool. :)

Then I can merge.

@danieldg danieldg force-pushed the proxy-dynamic-tuples branch from 33548c8 to 928b313 Compare January 27, 2024 14:25
Deserializing a Structure will result in a Structure that borrows file
descriptors and strings from the source; similar to OwnedValue, add a
distinct type to allow deserializing without borrows.  This is needed to
have zbus::Proxy::call return a Structure.
A bound of `for<'d> zvariant::DynamicDeserialize<'d>` on the result type
of a call is sufficient to deserialize; use this bound instead of the
stricter `DeserializeOwned + zvariant::Type`.  Because there is a
blanket impl of DynamicDeserialize for any type that implements Type +
Deserialize, any call that was previously allowed will still be allowed
after this change.
This allows using types that only implement DynamicType in
macro-generated proxy functions.
@danieldg danieldg force-pushed the proxy-dynamic-tuples branch from 928b313 to 5696d5f Compare January 27, 2024 15:01
@zeenix zeenix merged commit 4dbcb15 into dbus2:main Jan 27, 2024
7 checks passed
@danieldg danieldg deleted the proxy-dynamic-tuples branch January 27, 2024 16:02
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

Successfully merging this pull request may close these issues.

dbus_proxy with DynamicType not working (requires Type to be implemented)
2 participants