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

Implement Future for RequestBuilder #908

Open
NeoLegends opened this issue May 11, 2020 · 4 comments
Open

Implement Future for RequestBuilder #908

NeoLegends opened this issue May 11, 2020 · 4 comments

Comments

@NeoLegends
Copy link

NeoLegends commented May 11, 2020

Hey, WDYT about implementing Future for RequestBuilder directly?

The future would, when awaited, consume the RequestBuilder and send the request, just what .send() would do. This would shorten common patterns like client.get("http://example.com").send().await to client.get("http://example.com").await. Even though .send() is only 7 characters, it kind of bothers me to have to type it every time, when an .await would already suffice.

@NeoLegends
Copy link
Author

If you think this is a good idea, I'd be happy to send in a PR for the implementation. :)

@seanmonstar
Copy link
Owner

I have wanted something like this, but I don't think having the builders implement Future directly is the best option. I tried adding IntoFuture to the standard library, it's stalled due to compiler regressions:

rust-lang/rust#67982

@NeoLegends
Copy link
Author

I see, IntoFuture really is the way to go here. Keep this issue open to track that?

@dbofmmbt
Copy link

dbofmmbt commented Feb 8, 2023

I guess this issue could be closed in favor of #1632, based on the previous discussion.

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

No branches or pull requests

3 participants