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

at the time of Pipeline::send, context doesn't need to be mutable #1355

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

demoray
Copy link
Contributor

@demoray demoray commented Sep 5, 2023

Up until we get to Pipeline::send, Context can (and likely will) be mutable. However, once we start processing the pipeline, it doesn't need to be mutable anymore. This is due to Policy::send not requiring mutable context.

The changes to azure_iot_hub and azure_security_keyvault are related to longer requiring mutable contexts once we get to Policy::send.

Ref:

pub trait Policy: Send + Sync + std::fmt::Debug {
async fn send(
&self,
ctx: &Context,

Up until we get to `Pipeline::send`, Context can (and likely will) be
mutable.  However, once we start processing the pipeline, it doesn't
need to be mutable anymore.  This is due to `Policy::send` not requiring
mutable context.

The changes to `azure_iot_hub` and `azure_security_keyvault` are related
to longer requiring mutable contexts once we get to `Policy::send`.

Ref: https://github.com/Azure/azure-sdk-for-rust/blob/43d4e9974060e78bbd8912ddcc183567781997fc/sdk/core/src/policies/mod.rs#L30-L33
@demoray demoray merged commit f704e9a into Azure:main Sep 8, 2023
16 checks passed
@demoray demoray deleted the context-is-not-mutable-at-pipeline-send branch September 8, 2023 14:39
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

Successfully merging this pull request may close these issues.

2 participants