-
Notifications
You must be signed in to change notification settings - Fork 248
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
Should Pager
take a lifetime or owned ClientMethodOptions
#1911
Comments
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8947125dcdfa4ad98bf208f8c2918bc2 might be another way to do this efficiently: a generic helper to deserialize just the next link. |
Another factor to consider here is that as long as I'm not saying that's a dealbreaker, but it's another reason to consider a lifetime argument. Using a lifetime argument would tie the If we want a kind of "best of both worlds" approach, we could give |
I think that's a reasonable expectation. I mean, it's not strictly required conceptually - you could create a client just to get a pager - but that would be atypical given typical usage patterns I've seen. That said, there's really not much to clone anyway: client options are used to construct a |
So far, I mostly agree. That's all I've had to clone to make |
Don't get me wrong: I think lifetime parameters are fine. I've only pressed lightly (IMO) to avoid them to make the API easier but, where they are helpful and make a significant impact - by some definition of "significant" - we absolutely should use them. |
Before GA we need to decide if
Pager
should take a lifetime parameter in order to reference the originalClientMethodOptions
(rather, wrapper options) that was passed to the client method that created thePager
, or keep the existinginto_owned(self) -> Self<'static>
method defined in the emitter today.See https://github.com/Azure/typespec-rust/pull/147/files#r1835097479 for context.
The text was updated successfully, but these errors were encountered: