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 some quality-of-life gdbus helpers #1558

Merged
merged 6 commits into from
Nov 2, 2024

Conversation

swsnr
Copy link
Contributor

@swsnr swsnr commented Oct 28, 2024

Add a helper to return a standard result type from an invocation, automatically wrapping the return value into a tuple if it isn't a tuple yet.

Add another helper to return an async result from a future.

Update the gdbus example to demo the new async helper, and show how to simplify parameter handling with auto-derived variant structs.

examples/gio_dbus_register_object/main.rs Outdated Show resolved Hide resolved
gio/src/lib.rs Outdated Show resolved Hide resolved
@swsnr swsnr force-pushed the dbus-invocation-qol branch 2 times, most recently from c17799f to 8dc90c6 Compare October 31, 2024 19:58
@swsnr
Copy link
Contributor Author

swsnr commented Oct 31, 2024

Accidentally committed some left over change, I'll fix this tomorrow.

@swsnr swsnr force-pushed the dbus-invocation-qol branch 2 times, most recently from 4d89fbe to 149f77c Compare November 1, 2024 17:06
@swsnr
Copy link
Contributor Author

swsnr commented Nov 1, 2024

@sdroege Pipeline passes now, but the question about the name still stands... should I rename the method?

This trait represents a parsed method call with deserialized arguments,
to abstract over call parsing.

Then add new registration builder helpers to register method calls with
a simplified callback which receives parsed arguments, and can
optionally return an async result.
Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

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

@bilelmoussaoui bilelmoussaoui merged commit e654278 into gtk-rs:main Nov 2, 2024
48 checks passed
@bilelmoussaoui bilelmoussaoui added the needs-backport PR needs backporting to the current stable branch label Nov 2, 2024
@swsnr swsnr deleted the dbus-invocation-qol branch November 2, 2024 10:16
@swsnr
Copy link
Contributor Author

swsnr commented Nov 2, 2024

Thank you for reviewing and merging 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport PR needs backporting to the current stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants