-
Notifications
You must be signed in to change notification settings - Fork 283
plan using into_future for services #520
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
Conversation
}) | ||
} | ||
|
||
pub struct Client(pub(crate) super::Client); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow new type
pattern for modules.
I'm not sure what a scope is; can you elaborate? |
With the pipeline, the user-agent header is set:
Thanks @heaths! Can you verify the above is correct? Looks find to me. |
Yep, looks good. Thanks! |
Co-authored-by: bmc-msft <[email protected]>
#[derive(Clone)] | ||
pub struct Builder<'a> { | ||
pub(crate) client: crate::operations::Client, | ||
pub(crate) name: &'a str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Builder takes a lifetime, references can be passed in.
} | ||
|
||
impl<'a> Builder<'a> { | ||
pub fn into_future(self) -> futures::future::BoxFuture<'a, std::result::Result<models::OperationList, Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then the future is limited to that lifetime. Is that okay or do we want a 'static
lifetime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For #527, I left the parameters in Builder
as owned so that the BoxFuture
lifetime is 'static
.
#527 is ready for review. |
This attempts to follow #510 for services by:
into_future
on the BuilderIt is also using
new type
pattern for other sub-clients.