codegen: Use async keyword for not in traits functions#1482
codegen: Use async keyword for not in traits functions#1482bilelmoussaoui wants to merge 1 commit intomainfrom
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.
gtk-rs/gtk4-rs#1421 (comment) FWIW. This will now create differently behaving API depending on whether it's in a trait or not
sdroege
left a comment
There was a problem hiding this comment.
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