You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aws-sdk-rust's codegen produces FluentBuilders which provide future-like builders which must be send() off in order to be awaited. Arguably the send itself is boilerplate since the builder can be treated like a future. I am proposing to implement IntoFuture for all builders.
The .await keyword desugars into a call to IntoFuture::into_future first before polling the future to completion. IntoFuture is implemented for all T: Future which means the into_future method will be available on all futures.
Key notes: This has somewhat a trivial performance consequence as this is making a heap alloc for the future along side a dynamic network call. If such a penalty is not acceptable, then send may still be used as an alternative. If the sdk team would not like to introduce a disparity between the two calls then RFC 2515, "Permit impl Trait in type aliases" is required before implementation.
Proposed implementation would be the implementation linked directly above, and reimplementing with RFC 2515 when stabilized. Since the current implementation returns an opaque future, introduction of RFC 2515 shouldn't be a breaking change.
Other Information
This maintains backwards compatibility and allows eventual deprecation of send if such a breaking change is desired, and also allows new usage of immediately awaiting the builder.
Acknowledgements
I may be able to implement this feature request
This feature might incur a breaking change
A note for the community
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue, please leave a comment
The text was updated successfully, but these errors were encountered:
Describe the feature
aws-sdk-rust's codegen produces FluentBuilders which provide future-like builders which must be
send()
off in order to be awaited. Arguably thesend
itself is boilerplate since the builder can be treated like a future. I am proposing to implement IntoFuture for all builders.Use Case
Remove boiler plate.
Proposed Solution
According to rust docs: https://doc.rust-lang.org/std/future/trait.IntoFuture.html
Therefore this is the proposed solution
Key notes: This has somewhat a trivial performance consequence as this is making a heap alloc for the future along side a dynamic network call. If such a penalty is not acceptable, then
send
may still be used as an alternative. If the sdk team would not like to introduce a disparity between the two calls then RFC 2515, "Permit impl Trait in type aliases" is required before implementation.Proposed implementation would be the implementation linked directly above, and reimplementing with RFC 2515 when stabilized. Since the current implementation returns an opaque future, introduction of RFC 2515 shouldn't be a breaking change.
Other Information
This maintains backwards compatibility and allows eventual deprecation of
send
if such a breaking change is desired, and also allows new usage of immediately awaiting the builder.Acknowledgements
A note for the community
Community Note
The text was updated successfully, but these errors were encountered: