Azure / azure-sdk-for-rust

This repository is for the active development of the Azure SDK for Rust. For consumers of the SDK we recommend visiting Docs.rs and looking up the docs for any of libraries in the SDK.
MIT License
714 stars 248 forks source link

[Cosmos] Remove options builders and (most) `impl` parameters #1880

Closed analogrelay closed 3 weeks ago

analogrelay commented 3 weeks ago

This realizes some recent changes to guidelines regarding options and service method parameters. Specifically:

The options changes were easy and deleted a bunch of unnecessary boilerplate, my favorite! Avoiding the use of impls led to the following exceptions (which I mentioned when we were chatting about the guidelines earlier but will detail again here):

I left all those cases above alone, though we can absolutely continue discussions there.

cc @heaths @JeffreyRichter @RickWinter (as FYI for the exceptions pointed out above, though I'm sure we'll do some more formal API reviewing later)

analogrelay commented 3 weeks ago

Drafting while I add method_options to our options

analogrelay commented 3 weeks ago

Re-un-drafting. I've added a method_options: azure_core::ClientMethodOptions field to every method options type. Since that type carries an optional Context, I've also changed all our methods to use that Context as the base context we add our ResourceLink value to.