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

request builder send methods use &self argument #10

Open
db48x opened this issue Jul 29, 2022 · 1 comment
Open

request builder send methods use &self argument #10

db48x opened this issue Jul 29, 2022 · 1 comment

Comments

@db48x
Copy link

db48x commented Jul 29, 2022

I’m surprised to discover this, because usually finalizing a builder consumes the builder and returns a wholly new object. As currently written, the builder cannot be a temporary; it has to be kept around as long as the request and response are so that they can refer to it.

Was this a deliberate choice? If so, can you document the reasoning for it? If not, can we change the send (and stream) methods to take Self instead?

@jpopesculian
Copy link
Owner

I see what you mean 😞 Unfortunately I don't think it will be that easy because to really decouple everything we need to make the TwitterApi::send function non-lifetime dependent and at the moment, this is hooked into Authorization to get headers which allows for a Future response due to oauth2 refreshing. Unfortunately the oauth2 refreshing stuff also has some lifetime issues which I've raised here ramosbugs/oauth2-rs#179. I'll see if I can help them with that and get this moving towards that direction

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

2 participants