-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
codegen: Use async keyword for not in traits functions #1482
base: main
Are you sure you want to change the base?
Conversation
Keep the Pin<Box<T>> only for in trait async funcitons. Reduces the generated code a little bit :)
e469948
to
afc2a7e
Compare
async_future.success_parameters, error_parameters | ||
) | ||
} else { | ||
if in_trait { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gtk-rs/gtk4-rs#1421 (comment) FWIW. This will now create differently behaving API depending on whether it's in a trait or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good but I don't like that the API behaves different between traits and non-traits, and also that it's "shape" is different.
Maybe for traits we can make use of the async-trait
attribute macro for the time being then?
That is a possibility yes, I can find some time for that later. |
Should make this PR only simpler, I guess :) |
Now that async traits are stable, should we re-consider this and bump the minimal required rust version? |
Not yet, see the announcement of the stabilization of the feature. It explicitly asked people to wait using it for public API for various reasons. |
Keep the Pin<Box> only for in trait async functions. Reduces the generated code a little bit :)
gtk4-rs PR: gtk-rs/gtk4-rs#1421