Skip to content

feat(gax): add mutable extension accessors to RequestOptions - #6254

Open
olavloite wants to merge 1 commit into
googleapis:mainfrom
olavloite:gax-mutable-extension-accessors
Open

feat(gax): add mutable extension accessors to RequestOptions#6254
olavloite wants to merge 1 commit into
googleapis:mainfrom
olavloite:gax-mutable-extension-accessors

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Add get_extension_mut and get_extension_or_default_mut to the RequestOptionsExt trait and implement them for RequestOptions.

These methods allow client library layers to mutate request option extensions in place (such as injecting or updating headers in an existing HeaderMap) without needing to clone or re-insert the extension.

@olavloite
olavloite requested a review from a team as a code owner August 1, 2026 09:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bumps the version of google-cloud-gax to 1.14.0 and adds get_extension_mut and get_extension_or_default_mut methods to RequestOptions to support mutable extension retrieval. The review feedback correctly points out that the Clone trait bound on get_extension_or_default_mut is unnecessary because the default value is inserted directly by value, and removing it would make the API more flexible.

Comment thread src/gax/src/options.rs
Comment thread src/gax/src/options.rs
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (0dac6ea) to head (01be876).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6254   +/-   ##
=======================================
  Coverage   96.07%   96.07%           
=======================================
  Files         275      275           
  Lines       68829    68860   +31     
=======================================
+ Hits        66126    66160   +34     
+ Misses       2703     2700    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add `get_extension_mut` and `get_extension_or_default_mut` to the
`RequestOptionsExt` trait and implement them for `RequestOptions`.

These methods allow client library layers to mutate request option
extensions in place (such as injecting or updating headers in an
existing `HeaderMap`) without needing to clone or re-insert the
extension.
@olavloite
olavloite force-pushed the gax-mutable-extension-accessors branch from 615ee69 to 01be876 Compare August 1, 2026 10:19
@olavloite
olavloite requested a review from a team as a code owner August 1, 2026 10:19
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.

1 participant